installing python modules

installing python modules

frodopytlicek
Contributor Contributor
3,873 Views
6 Replies
Message 1 of 7

installing python modules

frodopytlicek
Contributor
Contributor

hello,

 

im new to python and im not able to use any module that is installed in my python 2.7. how can i connect standalone python to 3ds max python and force him to see the modules. i try to directly install modules to 3ds max python but with no success. always receiving "DLL load failed: The specified module could not be found." error

 

thanks for help

0 Likes
3,874 Views
6 Replies
Replies (6)
Message 2 of 7

frodopytlicek
Contributor
Contributor
nobody?
0 Likes
Message 3 of 7

Anonymous
Not applicable
I'd love to help, as I adore Python (even if I can't see it together with Max at this moment), but I suppose it could be a bit confusing. Did you have a look at this?
http://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__developer_python_extension_libraries_html
Message 4 of 7

Anonymous
Not applicable

The problem is that 3dsMax uses its own python endebed, and the Pyton on the system is in other folder...

 

The way to solve that is to set your environment variables, since python uses the sys.path environment variable to find the posibles path with instaled modules, you can add that path to the folder where the libraries are stored, so then when python starts can get that folder.

 

Another way to do this is to script add to enable the module source path directly to the system like:

 

import sys
sys.path.append('c:/myPythonModules/')

 

This way the path "c:/myPythonModules/" will be added to the sys.path, then you can import any modules in that folder into python.

 

Normaly python install external libraries in its contained folder  .../site-packages/  so that folder must be set in sys Path environment variable or eather added with above snipet, in order to be able to load those modules.


Remember to use the same version and system architecture for the python instalations in both your system and 3dsmax,,, use python 2.7 ( 32b / 64b) or else you will got dll problems!

 

You can get deep information in:

 

http://docs.autodesk.com/3DSMAX/16/ENU/3ds-Max-Python-API-Documentation/index.html?url=files/GUID-F9...

 

https://docs.python.org/2/install/

 

0 Likes
Message 5 of 7

frodopytlicek
Contributor
Contributor

Thanks!

i will try it asap and let you know 🙂

0 Likes
Message 6 of 7

frodopytlicek
Contributor
Contributor

can you explain why you cant see max an python together right know? im new to python and every point of view to this intrested me

thanks

0 Likes
Message 7 of 7

Anonymous
Not applicable

Max have not a full integration with python, I mean that there is no python console for 3dsMax as would be with Maya and python where you can use a console directly to execute commands.

 

Any way, there exists python with 3dsMax, but the only way to enable and use it you must do it via a 3th party software, I have use 2 IDE softwares to acomplish this...

 

Sublime Text 2

PyCharm

 

So what you do is that you connect your ide to work with 3dsMax, and make the command betwwn your ide stdout to the internal 3dsmax pyuthon to resolve the commands.

 

Here is how to set your pycharm to work with 3dsmax: http://www.ycdivfx.com/maxplus-and-pycharm-update/

 

greets

0 Likes