I have installed blender on three Ubuntu machines using the following commands:
sudo add-apt-repository ppa:thomas-schiex/blender sudo apt-get update && sudo apt-get install blender
Note that these are networked machines that I only have command line access to. Two of them work perfectly and one raises the following error when trying to import numpy in a blender script:
File "/usr/lib/python3/dist-packages/numpy/core/__init__.py", line 6, in <module> from . import multiarray ImportError: cannot import name 'multiarray'
To diagnose this I have printed the sys.path of blender python on the machines that work, and get this:
>>> for p in sys.path: ... print(p) /usr/lib/blender/2.79/scripts/addons_contrib /usr/lib/blender/2.79/scripts/addons /usr/lib/blender/2.79/scripts/startup /usr/lib/blender/2.79/scripts/modules /usr/lib/blender/2.79/python/lib/python35.zip /usr/lib/blender/2.79/python/lib/python3.5 /usr/lib/blender/2.79/python/lib/python3.5/plat-linux /usr/lib/blender/2.79/python/lib/python3.5/lib-dynload /usr/lib/blender/2.79/python/lib/python3.5/site-packages /usr/lib/blender/2.79/scripts/freestyle/modules /usr/lib/blender/2.79/scripts/addons/modules
On the machine that is failing to import numpy, the blender python sys.path is:
>>> for p in sys.path: ... print(p) /usr/share/blender/2.79/scripts/addons_contrib /usr/share/blender/2.79/scripts/addons /usr/share/blender/2.79/scripts/startup /usr/share/blender/2.79/scripts/modules /usr/lib/python36.zip /usr/lib/python3.6 /usr/lib/python3.6/lib-dynload /usr/lib/python3/dist-packages /usr/share/blender/2.79/scripts/freestyle/modules /usr/share/blender/2.79/scripts/addons/modules
So, for some reason, when I install blender, on this machine, it is using an external python3.6, when it should be using the python3.5 that is packaged with blender. Note that I can't even find a python directory in the installed blender. I have uninstalled, and reinstalled, My python path is unset. How can I diagnose and fix the blender installation on this machine?