Installing python noise package to maya 2016 - stuck

Hey,

So I want some simple perlin noise functions to add some noise (obviously) to stuff (a camera for example).

noise 1.2.2 package looks like it does exactly what I want

so I did these steps to attempt to install it for maya

downloaded ez_setup.py (I know pip is ‘better’ but no idea how to use pip within maya)
installed ez_setup.py using the command prompt “mayapy.exe c:\ez_setupt.py”

than in Maya ran

from setuptools.command import easy_install
easy_install.main(["noise"])

All seemed good. But when attempting to use said package

import noise

I get an ImportError

File “C:\Program Files\Autodesk\Maya2016\Python\lib\site-packages
oise-1.2.2-py2.7-win-amd64.egg
oise_init_.py”, line 12, in <module>

from . import _perlin, _simplex

ImportError: DLL load failed: The specified module could not be found.

Not sure if this is because noise is incompatible with Maya2016, or more likely I’m doing something wrong.

Any ideas?

many thanks

Sounds like noise has components written as a C-extension, which means it would need to be compiled against Maya’s internal version of python.
For Maya 2016, this would require a copy of visual studio 2012, and the source for the noise library.

thanks R.White

sounds right to me. No idea how to do what you just said though, but I guess I need to find a different noise function somewhere. thanks

Don’t forget that any .dlls loaded from a Python .pyd usually have to be in the system path. Either add it at the system level from the environment variables panel, or create a Maya launcher script that appends the correct path to the system path Maya inherits.

btribble, ah I didn’t realise dlls were contained in .pyd files. It looks like I ‘should’ have the dlls I need, I wish maya could be a little more verbose and tell exactly what dll it is missing, might help to track it down.
So I normally edit the maya.env file in \Documents\maya\2016, what do I need to add to this (currently empty by the way). Tried

MAYA_SCRIPT_PATH = C:\Program Files\Autodesk\Maya2016\Python\Lib\site-packages
oise-1.2.2-py2.7-win-amd64.egg
oise

but that didn’t work.

thanks

.pyd files are just .dlls compiled specifically for the Python API. .dll/.pyd files can also reference other .dlls on the system, in fact they often do. The most likely missing culprit are the VC redistributable modules (assuming we’re on Windows). Unfortunately, I can’t tell you which ones you need. You can drag a .pyd on Dependency Walker and it should tell you what it needs that is missing:

http://www.dependencywalker.com/

If it is a Visual Studio redistributable modules that is missing, the file will look something like Msvcr110.dll. The numbers in the .dll name are the Visual Studio version. I’ll let you google that to figure out which ones you need.

Here is the site for VS 2012 redistributable which should be the correct version for Maya 2016 I believe: https://www.microsoft.com/en-us/download/details.aspx?id=30679

Different compiler versions used by maya:

Make sure you don’t download these files from random sites. This is a common malware infection vector.

Also, I’m assuming that easy_install installed the correct flavor of module for Maya 2016 (Python 2.7, 64 bit). Finally, I’ve seen .pyd files that had to be recompiled from source to work with Maya’s version of Python. This all becomes much more difficult if this is the case…


Just attaching the result from the dependency walker.

I have the latest visual studio already installed, so the MSVCR90.dll should be there? Not sure where to look to check? Or how to download it separately (which I’ve heard isn’t a great idea)?

Assume it’s missing python27.dll because it’s not being run from within Maya? Although that might point to is needing to be compiled against maya’s version of python.

To be honest this is probably too complex, I just need to find a simple python script with a simplex/perlin noise function which I can drag into my scripts folder :slight_smile:

MSVCR90.dll is from VS2008 which is the compiler used for standard python2.7. Autodesk compiles their versions of python against newer versions of visual studio.
Your installation of noise isn’t the issue, instead the issue is attempting to run it from within Maya.
You’d need a version compiled against the maya’s internal python, and not compiled against a standard python installation.

thanks R.White for the confirmation. I’ve found a different package to get the noise function I want which works just fine (openSimplex). This is good stuff to know if I encounter the same issue again. thanks for the time and the replies both to you R.White and to btribble.

Good luck!