-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip
should be upgraded when the Python shims are added
#338
Comments
As per discussed in the other issues, autoproj should not install anything during bootstrap (other than importer's dependencies) because it can't know what should be installed. |
The problem is, we need this upgrade for installing some pip osdeps. We need to do this after the shims were set up, but before the pip osdeps are installed. Maybe we can get away with hooking into some package set's init.rb in this case. But I'd prefer if this would be done right at the |
Users that upgrade their pip system-wide ( |
FWIW: A more intricate version of this problem occurs on Ubuntu 20.04, with pip version 20.0.2. There it occurs, when you install some Python package dependency via
It works with the latest version of pip. It also works if the packages are installed with separate calls of |
I guess this is something that could be done by the PipManager, no ? Maybe to avoid spending a lot of time there, check the current version of pip and act only if we're below a certain version ? |
I think I would expect to find the upgrade code somewhere around here: https://github.com/rock-core/autoproj/blob/master/lib/autoproj/python.rb We have in one of our recent buildconf's init.rb a hack that checks the version and does the upgrade. Similar to this:
We do the global upgrade there, because at the time this code is run we can't be sure the Python environment is already set up. I'd prefer to do install the upgrade to the local environment though. |
Actually, even if this file creates the pip shims, it does not use pip. But then, where the update method is defined is one thing (whether in Autoproj::Python or Autoproj::PackageManagers::PipManager is not really important). What's bothering me is where it will be called. My understanding is that we can do it in |
With no particular reason I would have it happen somewhere below |
In principle, one can use activate_python without ever using pip. Since I see no particular reason why it is better to do it in activate_python, I'd rather do it when we know we have to use pip. |
I'd prefer to have a properly set up Python environment from the start, even if it's not immediately used by aup. Potential other reasons: If one day autobuild turns towards installing packages using pip too, that version check might need to be duplicated there. |
Please don't do this in places that will be called in commands that have nothing to do with osdeps. |
We have to be mindful of |
Sounds reasonable too. I hope you can find a place where this can be hookep up sensibly. |
On Ubuntu 18.04 the
python-pip
andpython3-pip
packages provide pip version 9.0.1, which doesn't provide features many pip packages require for installation these days, e.g., opencv afaik.Even when users had their pip upgraded and working for their user, when they set up the workspace they will default to the old version again, after the PYTHONUSERBASE is adjusted. Thus the installation of pip osdeps or pip packages can fail with obscure error messages, typically pointing towards missing dependencies.
This should be avoidable by running
{python_executable} -m pip install --upgrade pip
(or similar) after setting up the python workspace.Not sure if users are affected that did run the pip upgrade via sudo for the global install.
Otherwise I'd suggest this should be done for everyone, as the old version really isn't supposed to be run by anyone anymore.
Note sure if this is the right place to report this, or if this would be the better fit: https://github.com/rock-core/package_set/issues
The text was updated successfully, but these errors were encountered: