Hello,
This is really baffling me, I have a TD network that is using external modules - specifically in this case the z3 Theorem solver.
When I run the project on MacOS or Windows, it is working:
- I set the external module path for touch designer in the settings dialogue.
- and as a hack, I tried explicitly loading the modules in the Python script
But when another person tries to run the project, it just does not work. See the screen grab.
Does the weirdness with the path mean anything - the mixing of forward and back slashes?
Any advice is greatly appreciated.
what you can do instead is installing your pip modules to a specific folder withing your project tree with the --target=“path” flag. then, you can append those modules through a python script on project start with
import sys
sys.path.append(project.folder+‘/externals’)
your modules should then be importable everywhere accross your project, or maybe you need to append external on any concerned script, I dont remember fully
Hello @Lainhehe thanks for the reply.
This is what I had tried before but it does not work for the other TD user.
import os
import sys
import random
import numpy as np
# Add the relative path to sys.path
relative_path = "./external_modules"
absolute_path = os.path.abspath(relative_path)
if absolute_path not in sys.path:
sys.path.append(absolute_path)
# Now import the module
import z3