I have an .x3d code which references a python script. I am trying to implement certain functions which make use of the numpy module. However, I am only able to import the builtin modules from Python.
I am looking for a way to import the numpy module into the script without having to call the interpreter (i.e. "test.py", instead of "python test.py").
Currently I get "ImportError: No module named numpy".
My question is: Is there a way to import the numpy module without having to call from the interpreter? Is there a way to include numpy as one of the built-in modules of Python?
find where numpy is installed on your system. For me, it's here: /usr/lib/pymodules/python2.7
import it explicitly before importing numpy
import sys
sys.path.append('/usr/lib/pymodules/python2.7')
... if you need help finding the correct path, check the contents of sys.path while using your python interpreter
import sys
print sys.path
I'm going to guess that your #! line is pointing to a different python interpreter then the one you use normally. Make sure they point to the same one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With