Directory not empty: 'urllib3' when upgrading pip
See original GitHub issueDescription
When trying to upgrade pip from 22.0.4 to 22.2.2 on debian, I get the following error during the upgrade process
ERROR: Could not install packages due to an OSError: [Errno 39] Directory not empty: 'urllib3'
afterwards pip binary (/usr/local/bin/pip
) does not exist anymore
Another user online seems to have faced the same issue on alpine (for the same pip versions): https://stackoverflow.com/questions/73084494/pip-upgrading-within-the-python-alpine-image-error-could-not-install-packages
Expected behavior
Upgrade does not fail and I can use pip afterwards
pip version
22.0.4
Python version
3.10.5
OS
Debian
How to Reproduce
Using docker (for example):
FROM demisto/python3-deb:3.10.5.31797
RUN pip install --upgrade pip
Output
root@c93e6f957460:/# pip install --no-cache-dir --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages (22.0.4)
Collecting pip
Downloading pip-22.2.2-py3-none-any.whl (2.0 MB)
ββββββββββββββββββββββββββββββββββββββββ 2.0/2.0 MB 185.6 kB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.4
Uninstalling pip-22.0.4:
ERROR: Could not install packages due to an OSError: [Errno 39] Directory not empty: 'urllib3'
root@c93e6f957460:/# pip
bash: /usr/local/bin/pip: No such file or directory
Code of Conduct
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
EnvironmentError [Errno 39] "Directory not empty" while pip ...
Anyways I removed the file myself and ran the upgrade command and no errors this time. Share.
Read more >Changelog - pip documentation v22.3.1
Update vendored six to 1.16.0 and urllib3 to 1.26.5 (#10043) ... Ignore .dist-info directories if the stem is not a valid Python distribution...
Read more >pip install error: could not install packages due to an oserror
When I tried that, I had a copy error which stated that the path was too long, so it couldn't put the file...
Read more >Python3 pip3 install broken on Ubuntu
This method path is only available for packaged pip version (9.0.1 in my case). After running pip3 install --upgrade pip , pip versionΒ ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I can confirm that the workaround specified in the
fuse-overlayfs
issue resolves this for me. In my case I added the following to thebuildah
action.The Dockerfile works for me