Troubleshooting 3ds Max Python API

Why doesn't my CPython extension module load?

Check if your extension module was built and linked against a different version of Python. In order to use a CPython module with Python in 3ds Max, you must compile the CPython binaries against Python version 2.7.15. See Python extension libraries for more information.

I am trying to install an extension module but 3ds Max Python is not detected by the installer

Update the registry or manually install the module. Often modules support installation via manual steps or a Python module (for example, the Python "easy_install" module (http://pythonhosted.org/distribute/easy_install.html). See also Python extension libraries for more information.

I set a property but do not see the expected result

In Python, if you misspell a property when assigning it, a new field is added to the object as a result - for example: MyClass.fOotball = x, or worse yet: MyClass.GetValue = 42. It is legal to add or replace fields on an object at run-time; therefore no error occurs. The safest way to set a property is to use a Set function, for example: render.SetWidth(640).

I run my script and it works. However, when I restart 3ds Max and run the script again, I get an error.

When you run any Python code that affects the global environment (for example, importing a module), those settings persist during your session of 3ds Max. A common mistake is to rely on a module that was imported by another script, or to call a function that was created by another script.

I have a script (for example, "MyLibraryModule") that is imported by another script (for example, "MyProgram), but after I make changes to MyLibraryModule, the changes do not seem to take effect the next time I run "MyProgram".

Use the reload(MyLibraryModule) command to force Python to reload that module.

Common issues and their workarounds