-
Notifications
You must be signed in to change notification settings - Fork 159
pip3 broken? #983
Comments
Looks like a pip issue: pypa/pip#11319 |
I experienced the same error. I understand that it is a pip error, but if topgrade would update pip first (python3 -m pip install --upgrade pip), it would prevent the users from experiencing this error in the future. Requirement already satisfied: pip in ./.local/lib/python3.8/site-packages (22.2)
Collecting pip
Using cached pip-22.2.1-py3-none-any.whl (2.0 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.2
Uninstalling pip-22.2:
Successfully uninstalled pip-22.2
Rolling back uninstall of pip
Moving to /home/toshihiro/.local/bin/pip
from /tmp/pip-uninstall-37ltymkz/pip
Moving to /home/toshihiro/.local/bin/pip3
from /tmp/pip-uninstall-37ltymkz/pip3
Moving to /home/toshihiro/.local/bin/pip3.8
from /tmp/pip-uninstall-37ltymkz/pip3.8
Moving to /home/toshihiro/.local/lib/python3.8/site-packages/pip-22.2.dist-info/
from /home/toshihiro/.local/lib/python3.8/site-packages/~ip-22.2.dist-info
Moving to /home/toshihiro/.local/lib/python3.8/site-packages/pip/
from /home/toshihiro/.local/lib/python3.8/site-packages/~ip
ERROR: Exception:
Traceback (most recent call last):
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 167, in exc_logging_wrapper
status = run_func(*args)
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 247, in wrapper
return func(self, options, args)
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 461, in run
installed = install_given_reqs(
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/req/__init__.py", line 73, in install_given_reqs
requirement.install(
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/req/req_install.py", line 752, in install
scheme = get_scheme(
File "/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/locations/__init__.py", line 244, in get_scheme
from . import _distutils
ImportError: cannot import name '_distutils' from 'pip._internal.locations' (/home/toshihiro/.local/lib/python3.8/site-packages/pip/_internal/locations/__init__.py) |
Are you sure? By my understanding, upgrading pip first would just make it fail sooner. I don't think it's within topgrade's scope to account for unexpected behavior of tools like pip. |
Since topgrade is doing carefully |
By my understanding, rustup runs so any following cargo builds don't fail due to an outdated toolchain. If the same can be said about pip (i wouldn't know), that's a valid argument. But this issue is more akin to |
In my experience, there have been several times when the latest version of some library failed to install because the pip was out of date. So, in my mind, if pip fails, the right thing to do is to upgrade pip itself. However, it seems that the upgrade of pip itself can cause problems in a Windows environment, although I don't use Windows very often. So, I reconsider that it may be a hasty decision to include the upgrade function of pip itself in topgrade as a default behavior. |
Until this has been fixed in pip 22.2.2, you can update pip manually using this command (from pypa/pip#11319 (comment)).
|
What did you expect to happen?
Python packages should have updated. Running
pip3 list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip3 install -U
works without issue.What actually happened?
Additional Details
This won't help because I ran it after I manually upgraded the packages:
Same here:
The text was updated successfully, but these errors were encountered: