RoboDK Forum
Please don't run pip without the user's permission- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:RoboDK错误(//www.sinclairbody.com/forum/Forum-RoboDK-bugs)
+--- Thread: Please don't run pip without the user's permission (/Thread-Please-don-t-run-pip-without-the-user-s-permission)



Please don't run pip without the user's permission-j_cso-02-17-2023

Looks like when I use the postprocessor, it tries to use pip to install pyside2:

Installing required module: PySide2 ...
Running command:
/usr/bin/python3.8 - mπp install --upgrade pip

This could be pretty harmful. There are quite a few package management schemes for python, and pip will try to install dependencies automatically. So you could end up breaking somebody's whole dev environment by installing a dependency of pyside2 via pip that, say, hides a different version of the same package installed by apt, and is a critical component of some other software I'm writing.

Probably better to make the dependency optional (since it looks like the post runs just fine without it) or just ask the user nicely to install pyside2 rather than trying to do it for them.


RE: Please don't run pip without the user's permission-Sam-02-18-2023

Hi there!

I am very sorry if we broke your dev environment.
There is a little bit of history there, maybe we can find a way forward that will satisfy most users.

We rely on external dependencies outside RoboDK for GUIs, driver APIs, utilities and such.
As we try to facilitate the update and release of new features, we make use of the following function here and there:
//www.sinclairbody.com/doc/en/PythonAPI/robodk.html#robodk.robolink.import_install

I know, this is evil. This was put in place as most of our user base avoid command prompts and get pretty scared by a crash log for a missing or incompatible dependency.
On Windows, we provide our own installation of Python, and we add a bunch of these dependencies in PYTHON_PATH. This is the setup that 95% of users rely on.
On linux.. well. You know.

The dependency on PySide on Posts comes from the log window that is shown if errors are encountered. We could do the import_install 'just-in-time' at least for now.
It is however used quite a bit for Apps, which are embeddable Python scripts that often make use of numpy, OpenCV, Pillow, pandas, etc.

With the release of the Add-in Manager, there is now a prompt to install dependencies using pip for Apps that have a requirements.txt.
You can decide to postpone the installation or do it at a later time.
The Add-in manager does not support Drivers and Posts as of today, but we intend to port them too.

I think the Add-in Manager will mitigate our need to use import_install going forward, but other suggestions are welcome.