Closed nortikin closed 7 years ago
Hi.
Blender is bundled with its own Python distribution. It does not share libraries, modules or packages with system's Python. When you used pip to install PyMCubes, it was installed in system's Python and therefore it cannot be directly used in Blender.
There are two possible solutions:
$ python -c "import mcubes; print(mcubes.__file__)"
/home/username/anaconda3/lib/python3.5/site-packages/mcubes/__init__.py
In this case, the path with the mcubes
folder is /home/username/anaconda3/lib/python3.5/site-packages/
(your path might be different). You should append this path to the Blender Python sys.path. In your Blender script, write something like
import sys
sys.path.append("/home/username/anaconda3/lib/python3.5/site-packages") # Change this to your path
import mcubes
Note that this is a workaround, it might not work if the system Python and the Blender Python have different versions, and it should not be used in any production environment. Use this only if it is for personal use.
2. Install PyMCubes directly in Blender's Python distribution. As far as I know, installing external packages with compilable C++ code is not officially supported in Blender, although you can do it manually. I do not recommend this.
I've just found that you already did what I said.
I've seen that your Blender version is blender-2.78-linux-glibc211-i686
. This is a 32-bit build. However, your system Python is 64-bit. The library you compiled is _mcubes.cpython-35m-x86_64-linux-gnu.so
(note the x86_64
). Those two versions are incompatible: you cannot load a 64-bit library in a 32-bit environment.
Change your Blender version to a 64-bit build (one with x86_64
in the name instead of i686
). It should work then.
Omg. Thank you!
@nortikin You're welcome. :)
Let me know if it worked so I can close the issue.
thanks, i found two things lost - system path $PYTHONPATH was not exported as my system site-packages folder for python in /usr/lib/python3.5 also your suggestion for 64 bit works. Thanks!!!!
Hi, I am having the same problem as @nortikin my blender and python are 64bits but I receive the same message error, how can I fix? @pmneila thank you in advance!
https://github.com/nortikin/sverchok/issues/1549#issuecomment-295823624 here all description can load in bash, but not in blender:
PS installed as sudo pip3.5 install cython pymcubes etc...