When I use pip to install stuff it tells me
WARNING: You are using pip version 22.0.4; however, version 22.2 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
However when I try to install it I get a problem
/ # /usr/local/bin/python -m pip install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.7/site-packages (22.0.4)
Collecting pip
Downloading pip-22.2-py3-none-any.whl (2.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 21.2 MB/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'
The weird thing here is this is easily reproducable. I'm using the python:3.7-alpine image.
You can see this error like this,
podman run -ti python:3.7-alpine /usr/local/bin/python -m pip install --upgrade pip
What the right way to upgrade Python 3.7 using the Alpine image, such that I don't get this error,
ERROR: Could not install packages due to an OSError: [Errno 39] Directory not empty: 'urllib3'
You can see the Dockerfile to create the python:3.7-alpine image here