Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Installing Python Modules to a TouchDesigner-specific Path

Helpful techniques for working with TouchDesigner. Answers only, no questions.

Installing Python Modules to a TouchDesigner-specific Path

Postby doctorhandshake » Mon Nov 20, 2017 11:42 am

Got a question the other day about how to install packages to other than the default Python site-packages folder* — I have to reconstruct this every time I do it but a really simple method:

Code: Select all
pip install --target=/path/to/your/packages/directory/for/TD package_to_install


... and then just point Touch to that path for your Python 64-bit module search path in the prefs. It's probably a good idea to have a dependencies folder in the same directory as each project (see below).

* this is Good Practice - generally it's a Bad Idea to install anything to your system Python as then you have no idea what your dependencies are when you go to move a project to another system. Also updates can break old projects.

I've done a version of this with virtualenv and am trying to figure out how I did that (there's a flag for virtualenv that tells it to install dependencies in a specific directory, I think).

Also this should be possible with pipenv too. Both of those options allow you to 'freeze' an environment and make a requirements.txt file you can check in to a repo so users can pull down the right version of all your requirements fresh without your checking all your requirements into the repo, which is bloated and not a good idea.

I'll follow up if I remember how I did that.
Noah Norman
http://hardwork.party

codename: massapequa
User avatar
doctorhandshake
 
Posts: 76
Joined: Wed Aug 17, 2011 6:31 pm
Location: Brooklyn, NY

Return to Techniques

Who is online

Users browsing this forum: No registered users and 2 guests