Login | Register 
FEATURES
APPLICATIONS
DOWNLOADS
EDUCATION
BLOG
WIKI
FORUM
STORE

Popup-Error before first Python Script Execution

Report bugs so we can squash them!

Popup-Error before first Python Script Execution

Postby chrislos » Mon Aug 05, 2019 8:22 am

Hey folks,

I'm quite a newby in the TD world. I'm trying to import some external python modules from a 3.5 anaconda environment on mac 10.14.5 running TD build 2019.17550.

Good news first:
I could manage to execute my scripts as a separate python thread. *yay*

Bad news:
when I open my TD project and I want to run my script for the first time TD promts the attached popup error.
TouchDesigner argument error

An unknown argument:
-B
was given to TouchDesigner as a command argument.
If a path to a .toe file is being given, ensure it has quotes around it if it has spaces in the path.
Exiting.

As soon as I click OK and run the script again the popup doesn't occur anymore and the python code executes properly.



The popup occurs as soon as I import the libraries by executing the following script:

Code: Select all
import fnmatch
import os
import numpy as np
from sklearn.manifold import TSNE
import json
import threading
import sys
import librosa


My Python 64-Bit Module Path is:
"/anaconda3/envs/td35/lib/python3.5/site-packages"

.. so there are no spaces in the path name or anything else problematic I suppose.


In addition to that I renamed thy numpy module folder shipped with TD to under "/Applications/TouchDesigner099.app/Contents/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy" to "numpy_old" and used the one from my anaconda environment because it didn't work with the sklearn library.

Do you have any ideas what this popup may come from?

It's a bit strange to me because my script works properly in TD. The popup only occurs at the first iteration. After I press OK it works properly...

EDIT: I attached a simple toe file causing the popup.

Thanks in advance,
Christian
Attachments
popup_error.toe
(4.24 KiB) Downloaded 35 times
error.png
error.png (89.42 KiB) Viewed 658 times
chrislos
 
Posts: 1
Joined: Wed Jul 24, 2019 3:24 am

Re: Popup-Error before first Python Script Execution

Postby selina » Wed Aug 14, 2019 11:54 am

I took a quick look at your toe file but didn't install any additional libraries. If I'm understanding you correctly, you get the popup error when you click the Launch Process button in your sample file.

When I tried it, I left out this line and did not get any popup errors. Is that true for you?

Code: Select all
from sklearn.manifold import TSNE


If that is the case, if you leave the import line above, but comment out

Code: Select all
myThread = threading.Thread(target=hello)
myThread.start()


Do you still get the popup error? The popup error indicates to me that something is trying to launch another TouchDesigner process, and I'm wondering if it is the external module initializing and possibly trying to launch another python process by launching another instance of the parent process. -B appears to be a python option for "Don't write .py[co] files on import".
User avatar
selina
Staff
 
Posts: 858
Joined: Tue Nov 13, 2007 1:15 am

Re: Popup-Error before first Python Script Execution

Postby pointshader » Wed Aug 28, 2019 3:48 pm

I'm getting a similar error, but with the message "...unknown argument: -c was given to TouchDesigner as a command argument..." instead of -B like the original post.

This is on experimental 2019.30550, when trying to use the multiprocessing.Process.Process() function. POpen and manually specifying a python.exe works just fine, as highlighted in Matthew Ragan's subprocessing post.

I agree with your conclusion that starting a subprocess is somehow picking touchdesigner.exe instead of python.exe, so any subprocess initialization simply fails. If you keep a reference to the process handler, you can see that it executes but immediately terminates, even if you have an infinite loop in the function passed to the subprocess.
Jonathan Thompson
@pointshader
http://pointshader.com
User avatar
pointshader
 
Posts: 180
Joined: Mon Nov 01, 2010 3:15 am
Location: NYC

Re: Popup-Error before first Python Script Execution

Postby ben » Wed Aug 28, 2019 5:32 pm

Hi jmt4zj, Just a note to move off build 30550 which we pulled for a .toe breaking bug, please move to build 2019.30790
User avatar
ben
Staff
 
Posts: 2599
Joined: Thu Nov 08, 2007 6:55 pm
Location: Toronto


Return to Bugs

Who is online

Users browsing this forum: No registered users and 5 guests