But now when I try to import scipy.spatial.Voronoi, I get this error:
RuntimeError: module compiled against API version 9 but this version of numpy is 7
Traceback (most recent call last):
File "/project1/text1", line 1, in <module>
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
File "C:/Python33/Lib/site-packages\scipy\spatial\__init__.py", line 89, in <module>
from .kdtree import *
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
File "C:/Python33/Lib/site-packages\scipy\spatial\kdtree.py", line 8, in <module>
import scipy.sparse
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
File "C:/Python33/Lib/site-packages\scipy\sparse\__init__.py", line 206, in <module>
from .csr import *
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
File "C:/Python33/Lib/site-packages\scipy\sparse\csr.py", line 13, in <module>
from ._sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
File "C:/Program Files/Derivative/TouchDesigner088/bin/TouchInit.py", line 147, in tdcustomimport
r = previousimport(*args, **kw)
ImportError: numpy.core.multiarray failed to import
Can anybody point me to a version of scipy that will work?
Seems the issue is the distributed version of numpy that comes with TouchDesigner is incompatible with later versions of scipy.
You could install your own version of numpy into your standalone version of python.
You then need a way of getting TouchDesigner to ignore the built-in numpy:
You’ll have to examine the list for the exact path unfortunately, which is dependent on installation location and 32 vs 64 bit and forward vs backslashes.
app.installFolder
should give you it the location of the parent folder at least.
Hey,
sorry to dig this up but I’m stuck here. Fairly new to TD, but I read through this thread and the wiki and got up until here…
Got a Script Dat that does:
import sys
tdPath = 'C:\\Program Files\\Derivative\\TouchDesigner088\\bin\\lib\\site-packages'
mypath = "C:/Python33/Lib/site-packages"
if tdPath in sys.path:
sys.path.remove(tdPath)
if mypath not in sys.path:
sys.path.append(mypath)
and another one that does:
import numpy
print(numpy.__version__)
Sadly the Output of the second script in the Textport is still 1.7.0, eventhough it should be 1.9
any hints on where I might be going wrong? Is there a better way or place to call the path functions?
EDIT: reading through print(sys.path) helped to figure out the problem, removed the right path - works - yay!
It would be great if TD had support for python 3.4 or 3.5, with modules installed with Pip working out of the box. I tried very hard to make Scipy work with TD but i haven’t succeeded. It seems the reason is because there is no version of scipy compatible with 3.3, at least none is distributed.