Failed to import scipy with pyo3 #6079
-
|
Hi! While I was working with pyo3 to execute python scripts in a rust project, I found an error when importing scipy which I cannot solve. Environment
I am working inside a virtual environment with venv. ProblemI reduce my code to this minimal example: which give the following error: As recommanded in the error message, I tried a resintallation, without any success I tried to import scipy directly from a python shell in my virtual environment, no error (I checked that python.exe was the one from .venv\Scripts) I still suspect a bad configuration from my side, but I cannot found it. Here a copy of my build.rs which set the wanted env variables (keep in mind this script is temporary and will be reworked). Btw, should I used build.rs or another way to set env variable? Thanks for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
A bit of sleep on it and the solution became clear: problem was because of env variable order. my build.rs generated something like this while the correct one should be: (and same for PYTHONHOME obviously) I think the problem did not show up with the other libraries (like numpy) because they were also installed globally. |
Beta Was this translation helpful? Give feedback.
A bit of sleep on it and the solution became clear: problem was because of env variable order.
my build.rs generated something like this
while the correct one should be:
(and same for PYTHONHOME obviously)
I think the problem did not show up with the other libraries (like numpy) because they were also installed globally.