Results 1 to 10 of 10

Thread: Installing python noise package to maya 2016 - stuck

  1. #1
    undefined
    Join Date
    Jun 2016
    Posts
    8

    Default 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\noise-1.2.2-py2.7-win-amd64.egg\noise\__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

  2. #2
    while loop
    Join Date
    Feb 2010
    Posts
    179

    Default

    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.

  3. #3
    undefined
    Join Date
    Jun 2016
    Posts
    8

    Default

    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

  4. #4
    struct btribble's Avatar
    Join Date
    Feb 2009
    Location
    SF Bay Area, US
    Posts
    367

    Default

    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.

    http://serverfault.com/questions/351...nched-directly

  5. #5
    undefined
    Join Date
    Jun 2016
    Posts
    8

    Default

    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\noise-1.2.2-py2.7-win-amd64.egg\noise

    but that didn't work.

    thanks

  6. #6
    struct btribble's Avatar
    Join Date
    Feb 2009
    Location
    SF Bay Area, US
    Posts
    367

    Default

    .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/down....aspx?id=30679

    Different compiler versions used by maya:
    http://around-the-corner.typepad.com...ns-update.html

    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...

  7. #7
    undefined
    Join Date
    Jun 2016
    Posts
    8

    Default

    dependancies.jpg

    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 :)

  8. #8
    while loop
    Join Date
    Feb 2010
    Posts
    179

    Default

    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.

  9. #9
    undefined
    Join Date
    Jun 2016
    Posts
    8

    Default

    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.

  10. #10
    struct btribble's Avatar
    Join Date
    Feb 2009
    Location
    SF Bay Area, US
    Posts
    367

    Default

    Good luck!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •