Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find platform dependent libraries <exec_prefix> #278

Open
inverimus opened this issue Mar 12, 2023 · 3 comments
Open

Could not find platform dependent libraries <exec_prefix> #278

inverimus opened this issue Mar 12, 2023 · 3 comments

Comments

@inverimus
Copy link

inverimus commented Mar 12, 2023

I get this line "Could not find platform dependent libraries <exec_prefix>" when using python 3.11 with nimpy on windows. Using python in any other way does not cause this message to appear. It doesn't seem to cause any problems and everything works normally, just wondering if anyone knows of a way to fix this. It doesn't happen with any previous version of python I've tried.

@eniven
Copy link

eniven commented Apr 4, 2023

I too am having this problem. (Python 3.9.13 Anaconda install on Windows).

@yglukhov
Copy link
Owner

yglukhov commented Apr 10, 2023

It seems it has more to do with anaconda/venv rather than with nimpy: https://stackoverflow.com/questions/19292957/how-can-i-troubleshoot-python-could-not-find-platform-independent-libraries-pr

I've never used venv so can't tell for sure. I'm open to suggestions if there's anything we can do.

@hmbemba
Copy link

hmbemba commented Oct 6, 2023

I was struggling for a while trying to call a python func FROM nim, but the func depends on a library installed in a virtual env

from pyfiglet import Figlet

def test():
    f = Figlet(font='slant')
    print(f.renderText('text to render'))

here is my nim code and here is the compile script

nim c -r main.nim
import strutils
import nimpy

let py = pyImport("main")

discard py.test()

when compiling I would get an error saying the module was not found

Error: unhandled exception: <class 'ModuleNotFoundError'>: No module named 'pyfiglet' [Exception]

I solved this by modifying the sys path IN my python script to add the sitepackages of my venv

import sys
sys.path.append(r'C:\Users\...\Desktop\Scripts\Temp_Projects\nimpy_test_venv_interop_10_06_2023-01_25PM\venv\Lib\site-packages')

from pyfiglet import Figlet
f = Figlet(font='slant')

def test():
    print(f.renderText('text to render'))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants