3ds max 2022 Python - 3rd Party Libraries, venv, PyCharm

3ds max 2022 Python - 3rd Party Libraries, venv, PyCharm

Huston94
Enthusiast Enthusiast
1,249 Views
1 Reply
Message 1 of 2

3ds max 2022 Python - 3rd Party Libraries, venv, PyCharm

Huston94
Enthusiast
Enthusiast

Hello,

 

I am really excited about the new updates to Python in the recent versions of 3ds max. But I always seem to run into trouble when it comes to the topic of 3rd Party Libraries, Virtual Environments, and PyCharm. PyCharm doesn't seem to see 3ds Max's Python setup as valid as it always errors when trying to install packages from the package manager and Virtual Environments don't seem to be created properly to work with PyCharm (when creating through Autodesk recommended cmd method or through PyCharm's menu).

 

I always see a warning in the Project Interpreter setup saying "Python packing tools not found" with a button that tries to install them but install always fails with the same message about "*hard drive path*\setuptools-40.8.0' does not exist". I get the same error both when I'm using the regular 3ds Max Python interpreter and trying to install packages and when I'm trying to create a Virtual Environment from the 3ds Max Python interpreter.

 

If anyone has figured this out or can point me in the right direction please let me know. I would greatly appreciate it.

0 Likes
1,250 Views
1 Reply
Reply (1)
Message 2 of 2

MartinBeh
Advisor
Advisor

What is the benefit of using PyCharm with 3ds Max?

Using the 3dsmax-provided python.exe, installing 3rd party libraries seems to work well, once pip is installed.

 

 

.\python.exe -m pip install numpy --user

 

 

This will place the package contents into 

 

 

c:\users\yourusername\appdata\roaming\python\python3X\site-packages

 

 

 I have not tested using virtual environments in combination with 3ds Max; the issue might be that most of 3ds Max functionality is only available when 3ds Max is running, but that might make it hard to set environments?

Edit: Just saw this post: https://forums.autodesk.com/t5/3ds-max-programming/start-3dsmax-with-virtual-environment/td-p/106480...

which boils down to: 1.) make sure venv is installed, 2.) open cmd and activate environment using .bat, 3.) with environment active in same cmd start 3dsmax.exe - you may check VIRTUAL_ENV environment variable afterwards

 

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes