When i try to import numpy in MAYA i am getting an error.
# Error: ImportError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\__init__.py line 26: Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
I have numpy 1.16.1; python 3.7
Numpy is already added to python path. C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\numpy
I can import Numpy in cmd. it says __init__.py line 26: Importing the multiarray numpy extension module failed..
line 26 empty in the script..
I tried to reinstall numpy many times. I'm beginner in MAYA and Python.
I'd be grateful for help.
When i try to import numpy in MAYA i am getting an error.
# Error: ImportError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\numpy\core\__init__.py line 26: Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
I have numpy 1.16.1; python 3.7
Numpy is already added to python path. C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\numpy
I can import Numpy in cmd. it says __init__.py line 26: Importing the multiarray numpy extension module failed..
line 26 empty in the script..
I tried to reinstall numpy many times. I'm beginner in MAYA and Python.
I'd be grateful for help.
@Anonymous :
I personally haven’t tried this yet (not using Windows, and I’m comfortable building these kinds of packages), but right off the bat you are using a Python 3.7 compatible module, which will have a 99.9% chance of not working with Maya's Python. Internally, Maya uses 2.7.11 (or 14 in macOS) so you'll need to use the python27 wheel, not the python37 one.
Cheers,
Mike
Hey there,
This is an old post. But to get you started refer to this one instead.
In it you'll find this google drive link , all the modules in there i compiled for Maya 2018. They seem to work on older versions as well but i give no guarantees. Follow the link and grab numpy (and scipy). Install the wheels (you can rename .whl to .zip and extract manually if you don't know how to install packages) and move the numpy directory somewhere that can be seen by Maya.
That should be it! Good luck!
I am a student learning about it and met a question.I follow you step to download and copy the numpy package to D:\maya\Maya2018\Python\Lib\site-packages,and then run my python plugin in maya script editor ,it still has error which is " ImportError: file D:\maya\Maya2018\Python\lib\numpy\__init__.py line 140: cannot import name _distributor_init # " ,it made me confused .I have tried many ways but failed.I use win10 and python27.Hoping to your reply.
@skuzee wrote:
I've seen a lot of queries about getting scipy working in Maya (Windows 64 bit) with a few not 100% reproducible answers.So after a long personal struggle with the problem, here's my solution which will hopefully end the madness for all Windows Maya users:TL;DR versionunzip them somewhere relevant to PYTHONPATH. Congratulations! You can now use scipy in all it's glory!Long versionWhat you need is a fully functional Python interpreter compiled with MSVC2010. The steps for how to do that can be found here. Fortunately, the author not only explains the steps for how and why doing this is a good idea, but also provides pre-built binaries which is really nice of him. So go ahead and download the 2.7.10 64bit build and unzip it somewhere (I put mine here: "C:\Python27"). You can then use PIP to install a properly packaged Python wheels which should play nice with mayapy.Python wheels are awesome because when properly packaged they don't require compilers to install C extensions. Unfortunately our new version of Python isn't part of the standard distribution, so existing "official" numpy and scipy wheels won't work for us. However, there are developers out there who have made custom wheels which will suit our needs. The one I used is made by "carlkl", a dev I've yet to directly contact to shower him with praise.His builds use OpenBLAS, which I haven't benchmarked against builds made with Intel MLK, but they work fine for my needs and, I presume, most Maya users out there. To get the packages, find your new version of PIP you just installed (mine is at "C:\Python27\Scripts\pip.exe") and run these two commands:pip install -i https://pypi.anaconda.org/carlkl/simple numpypip install -i https://pypi.anaconda.org/carlkl/simple scipyOnce PIP has installed *both* packages you can either point mayapy's PYTHONPATH to where PIP installed the packages, or copy them to "C:\Program Files\Autodesk\Maya20XX\Python\Lib\site-packages" or whatever location you keep your python modules. DO GRAB BOTH PACKAGES and don't mix and match scipy with a different builds of numpy or it will complain about DLL linking errors.Congratulations, you're ready to rock!Quick disclaimer: I recently noticed that running numpy.test() and scipy.test() *does* make mayapy crash, and i'm not entirely certain why but I do suspect it is benign. I've been using this build of scipy heavily in our tools and it's been stable and happy.Cheers everyone!
I met the same question too. the error is about " ImportError: file D:\maya\Maya2018\Python\lib\numpy\__init__.py line 140: cannot import name _distributor_init # " ,and I want to know how do you solve your problem , I have tried many ways but failed. Hoping to your reply.
been there.
you should do as instruction says.
1) install python27(as expample)(37 dosn't work)
2) with python installer install libs from correct path (
Can't find what you're looking for? Ask the community or share your knowledge.