external python module dependency/version conflicts?

I am trying to get the SciPy library up and running in Touch, it requires a few dependencies, namely numPy, which is included by default with Touch’s python files.

Problem is, the version included with Touch is 1.7, and SciPy requires version 1.9 of numPy.
I can source an external python install in preferences, but when I try to import the library in question it never get’s as far as the external path because it hits the first one it finds, and errors out.


How can I tell Touch to ignore or overlook the first version of the library it’s coming across and to only source from the external python install? Is this even possible? Would I need to modify the TD python files in programFiles?

Modifying the source wouldn’t trouble me really but seeing as I’m trying to make software that will eventually be publicly available, I want install and setup to be as simplified as possible. Hopefully being able to leverage TouchPlayer as well.

Thanks!
Lucas

So I’ve tried inserting the path to my standalone winPython install at the beginning of sys.path like this:

[code]import sys

custPath = ‘C:\WinPython_343\python-3.4.3.amd64\Lib’

if(custPath not in sys.path):
sys.path.insert(0, custPath)

print(sys.path)

import numpy
print (numpy.path)
[/code]

However I get a huge amount of errors which seems to indicate numpy can’t find other files it needs or something?

Traceback (most recent call last): File "/project1/calculateBorder/text1", line 8, in <module> File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\__init__.py", line 137, in <module> from . import add_newdocs File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\add_newdocs.py", line 9, in <module> from numpy.lib import add_newdoc File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\lib\__init__.py", line 4, in <module> from .type_check import * File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\lib\type_check.py", line 8, in <module> import numpy.core.numeric as _nx File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\core\__init__.py", line 45, in <module> from numpy.testing import Tester File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\Program Files\Derivative\TouchDesigner088\bin\lib\site-packages\numpy\testing\__init__.py", line 8, in <module> from unittest import TestCase File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\WinPython_343\python-3.4.3.amd64\Lib\unittest\__init__.py", line 59, in <module> from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\WinPython_343\python-3.4.3.amd64\Lib\unittest\case.py", line 6, in <module> import logging File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\WinPython_343\python-3.4.3.amd64\Lib\logging\__init__.py", line 40, in <module> import threading File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 190, in tdcustomimport r = previousimport(*args, **kw) File "C:\WinPython_343\python-3.4.3.amd64\Lib\threading.py", line 35, in <module> _set_sentinel = _thread._set_sentinel AttributeError: 'module' object has no attribute '_set_sentinel'

Am I missing something obvious here? or doing something wrong?

Got this working, instead of using winPython which is a huge premade portable python environment, I used the clean python install I had on C:/

However I had to use the unofficial numpy binaries that were compiled for windows/64bit
[url]Archived: Python Extension Packages for Windows - Christoph Gohlke

when you download those, use ‘pip install somename.whl’ and it should install fine.

Then the sciPy whl from the same site installed fine after that!
Lucas

I got this problem too:-
File “C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py”, line 190, in tdcustomimport …
Been trying to solve this issue by reinstalling TD, installing latest python version, following set examples from TD site, tried with paid TD version etc., but nothing works until today where by chance, I just type in “numpy import” on the textport command line itself, then the problem went away. So everytime when running new TD toe file, I have to open up the textport and type in that command for numpy modules to properly load into the system and then I can run my program without any issues, hopefully though.

Can TD expert advise on this matter, please.

Thank You.