I'm using MacOS Catalina and I following this question to install scipy with my addon: How to write my add-on so that when installed it also installs dependencies (let's say: scipy or numpy-quaternion)?
Running this code downloads and installs the module so I can use it in Terminal:
>>> import scipy
>>> print(scipy.pi)
3.141592653589793
However Blender doesn't see the module:
Traceback (most recent call last):
File "/Text", line 2, in <module>
ModuleNotFoundError: No module named 'scipy'
Error: Python script failed, check the message in the system console
What I noticed is that if I try to run the install code again, I see this in the console:
Requirement already up-to-date: pip in /Applications/Blender.app/Contents/Resources/2.83/python/lib/python3.7/site-packages (20.1.1)
Requirement already satisfied: scipy in ./.local/lib/python3.7/site-packages (1.4.1)
Requirement already satisfied: numpy>=1.13.3 in /Applications/Blender.app/Contents/Resources/2.83/python/lib/python3.7/site-packages (from scipy) (1.17.0)
So scipy is located in ./.local and other modules are in Blender.app/Contents/. Does anyone know how can I fix this and use scipy in my addon?
bpy.app.binary_path_pythonto get the path to Blender's Python as shown here. – Robert Gützkow May 22 '20 at 20:09matplotlibyou had there) it works, when I changed it toscipyI got the same warning as before:Requirement already satisfied+ failed to import the module https://imgur.com/a/pbA4FC2 – Sergey Kritskiy May 23 '20 at 05:52scipythat I had before, reinstalled it from your addon and it works now, thank you! Do you have any idea what has happened? I checked andbpy.app.binary_path_pythonwas the same path that I used in my script (str(py_exec)). Was it because something about using a wrong pip..? – Sergey Kritskiy May 23 '20 at 05:59--userflag. There are some improvements planned that would allow this to work properly, but they are not implemented yet (see https://developer.blender.org/T71420) – Robert Gützkow May 23 '20 at 07:43sys.pathif your using--user. – Robert Gützkow May 23 '20 at 16:40