TD PIP
oh, this is nice!
Question: when using āImport_Module()ā how do I perform a import qrcode as qr
?
Thanks
Import_Module is the equivilant of import as, so you just write qr = op(āpipā).Import_Module( āqrcodeā ) and then use qr as if you used the import as statement.
Thanks, glad you like it. The question of how to get PIP to work with TD just came up to often so i had to take a shot
A little update: I was under the assumption that the names in pip and the module names are the same, which is in fact not the case.
The Import_Module method offers now an optionaƶ pip_name argument to define the package name seperate from the module name.
I updated the PIP-Version. (I need to find a way to do that dynamiclyā¦) and now default install setuptools with the first init routine !
Hey All,
Iām having a bit of trouble here. After starting and saving a new .toe, I dropped TD_PIP.tox into that same folder, then drag the TD_PIP.tox onto my network editor, which creates the TD_PIP base.
I understand that TD_PIP is best used by scripting the module imports (op(ātd_pipā).InstallPackage( package_name )), but I canāt even get it to work āmanuallyā by typing the name into āpackageā param and clicking the āinstallā pulse button.
For example, I am using āpygletā package.
The ācheckā pulse button works, and I receive āpackage not installed.ā But when i click āinstallā pulse button, nothing happens. I looked at the log inside of TD_PIP and it simply just says āfailed installing package.ā I tried 3 other packages, no dice.
What OS are you o?
Mac OS 12.2.1
TD Pip is not supported on MacOS for the forseeable future.
This is just excellent. Great job, and thanks for sharing with us.
Hi! Iām new to external libaries in Touchdesigner. Iāve tried using your .tox file and although it does create a lib folder, I canāt seem to get it to download packages. Iāve tried using your example of
qrcode = op(ātd_pipā).Import_Module(āqrcodeā)
I open a text dat and cut and paste that in then run script and then I check the lib folder but nothing new is there. I"ve tried putting qrcode into the packge parameter on the Custom page within the tox but that doesnāt seem to do anything either. It looks like my powershell on my computer opens momentarily but it closes before I can see whatās happening. When I open powershell manually it doesnāt show any activity.
Iām trying to use this repo: https://github.com/PetalTech/petal-api-getting-started/tree/master/python.
I tried opening a text DAT and running
op(ātd_pipā).InstallPackage( petal-api-getting-started )
to which I got an error saying petal was not defined.
So I tried
petal = op(ātd_pipā).Import_Module(āpetal-api-getting-startedā)
and received the following error:
AttributeError: āNoneTypeā object has no attribute āImport_Moduleā
Could you point me in the right direction? Much appreciated. Iād like to use your tool as it looks like such a good solution!
Kindest Regards,
E. Spencer Lewis
Heyho. Do you maybe have a .toe file for me to check?
Also, which OS are you using? Which TD Version are you rinning?
TD_PIP is currently not supported on MacOS.
Also, how does your libFolder look like?
Hi! When installing pip the installation fails, do you have any ideas why that could be?
Which OS are you on? How does it fail? Any more info?
Im running windows 10 on amd64, it throws an exception during installation of pip. Sometimes it works sometimes it doesnāt, I would love for it to be consistent
after looking a bit more into it, why donāt you just use the ensurepip module instead of using the wheels inside itās source files?
Can you please set āTOUCH_TEXT_CONSOLEā env variable to 1 and check what the output to narrow it down? Did not have any issues with that so need some more hints to āmake it consistentā.
Also, please post the exceptionā¦
Regarding using ensurepip: There were reasons for not using it, but not sure right now, can revisit it.
EDIT: Did a quick test: The problem is that ensurepip opens a subprocess which in TD is a new TD-Instance instead of the python interprete, which results in an error.
Also, the unpacking is basicly 1 to 1 what the esnurePIP is doing.