Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please don't run pip without the user's permission
#1
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 pip 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.
#2
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/robo...rt_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.
Please read the论坛Guidelinesbefore posting!
Find useful information about RoboDK by visiting ourOnline Documentation.




Users browsing this thread:
1 Guest(s)