Author Topic: Installing Python Extension Libraries  (Read 820 times)

Hey everybody,

Something I have been wondering for a while is how to install 3rd party Python libraries into the Substance Designer Python environment, if its even possible. It seems like it should be since the Python setup in the Program Files is virtually the same as the Desktop install. I'm just not sure how to actually do it. Is it possible to use pip somehow or is there some more manual way to do it?

There are so many incredible libraries that I want to implement into my Substance scripts but I am limited by my knowledge on how to set up environments and this topic is very difficult to find online for this specific case. I would like to be able to install libraries for database connections (other than sqlite3), machine learning, image processing, array tools, etc.

I'm also hoping this will translate into other Python enabled software like Nuke, 3ds Max, Maya, etc.. If it doesn't let me know. I would just really love to understand how to set up these custom Python environments within software to take my tools to the next level.

Hi,

You can use Python's virtualenv to create virtual environments in your plugin's directory and modify sys.path in your plugin initialization code to add the virtualenv directory with the dependencies you want to use to Python's path. After that you can import the installed modules. That works in Maya, Nuke and other apps too.

Installing or updating Python modules in Designer's install directory is not recommended.
A future update could delete the modules you installed or be installed in another directory and your modules would not be available.

Est.