Skip to content

Instantly share code, notes, and snippets.

@tomwhoiscontrary
Created February 18, 2020 16:52
Show Gist options
  • Save tomwhoiscontrary/8ceea601428f7e0a8701845490f8bce7 to your computer and use it in GitHub Desktop.
Save tomwhoiscontrary/8ceea601428f7e0a8701845490f8bce7 to your computer and use it in GitHub Desktop.
The incredible self-destructing pip
$ python3 --version
Python 3.4.5
$ python3 -m venv myenv
$ cd myenv
$ bin/pip install requests
Collecting requests
Using cached https://files.pythonhosted.org/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests)
Using cached https://files.pythonhosted.org/packages/e8/74/6e4f91745020f967d09332bb2b8b9b10090957334692eb88ea4afe91b77f/urllib3-1.25.8-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests)
Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
Using cached https://files.pythonhosted.org/packages/b9/63/df50cac98ea0d5b006c55a399c3bf1db9da7b5a24de7890bc9cfd5dd9e99/certifi-2019.11.28-py2.py3-none-any.whl
Installing collected packages: urllib3, idna, chardet, certifi, requests
Successfully installed certifi-2019.11.28 chardet-3.0.4 idna-2.8 requests-2.22.0 urllib3-1.25.8
You are using pip version 8.1.1, however version 20.0.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ bin/pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.1
Uninstalling pip-8.1.1:
Successfully uninstalled pip-8.1.1
Successfully installed pip-20.0.2
$ bin/pip freeze
Traceback (most recent call last):
File "bin/pip", line 7, in <module>
from pip._internal.cli.main import main
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/cli/cmdoptions.py", line 28, in <module>
from pip._internal.models.target_python import TargetPython
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/models/target_python.py", line 4, in <module>
from pip._internal.utils.misc import normalize_version_info
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_internal/utils/misc.py", line 20, in <module>
from pip._vendor import pkg_resources
File "/home/tom/myenv/lib64/python3.4/site-packages/pip/_vendor/pkg_resources/__init__.py", line 92, in <module>
raise RuntimeError("Python 3.5 or later is required")
RuntimeError: Python 3.5 or later is required
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment