Skip to content
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

Fix issue with pip 20.0 breaking on install #6598

Merged
merged 4 commits into from Jan 29, 2020
Merged

Fix issue with pip 20.0 breaking on install #6598

merged 4 commits into from Jan 29, 2020

Conversation

ericholscher
Copy link
Member

@ericholscher ericholscher commented Jan 28, 2020

For those finding this on GitHub, this is the step to reproduce thanks to @agjohnson:

rm -rf tmp/a
python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
/tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip
python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
/tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip

Example running in our docker container:

-> docker run --rm -it readthedocs/build:5.0 /bin/bash
docs@ae7bd8db6007:/$ set -x
docs@ae7bd8db6007:/$
docs@ae7bd8db6007:/$ rm -rf tmp/a
+ rm -rf tmp/a
docs@ae7bd8db6007:/$ python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
+ python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
Using base prefix '/home/docs/.pyenv/versions/3.7.3'
New python executable in /tmp/a/bin/python3.7
Also creating executable in /tmp/a/bin/python
Installing setuptools, pip, wheel...
done.
docs@ae7bd8db6007:/$ /tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip
+ /tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/54/0c/d01aa759fdc501a58f431eb594a17495f15b88da142ce14b5845662c13f3/pip-20.0.2-py2.py3-none-any.whl (1.4MB)
     |████████████████████████████████| 1.4MB 908kB/s
Installing collected packages: pip
  Found existing installation: pip 19.1.1
    Uninstalling pip-19.1.1:
      Successfully uninstalled pip-19.1.1
Successfully installed pip-20.0.2
docs@ae7bd8db6007:/$ python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
+ python3.7 -mvirtualenv --system-site-packages --no-download /tmp/a
Using base prefix '/home/docs/.pyenv/versions/3.7.3'
New python executable in /tmp/a/bin/python3.7
Not overwriting existing python script /tmp/a/bin/python (you must use /tmp/a/bin/python3.7)
Installing setuptools, pip, wheel...
done.
docs@ae7bd8db6007:/$ /tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip
+ /tmp/a/bin/python -m pip install --upgrade --cache-dir /tmp/a.cache pip
Traceback (most recent call last):
  File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/docs/.pyenv/versions/3.7.3/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/tmp/a/lib/python3.7/site-packages/pip/__main__.py", line 16, in <module>
    from pip._internal import main as _main  # isort:skip # noqa
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/tmp/a/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 25, in <module>
    from pip._internal.index import PackageFinder
ImportError: cannot import name 'PackageFinder' from 'pip._internal.index' (/tmp/a/lib/python3.7/site-packages/pip/_internal/index/__init__.py)

@ericholscher ericholscher changed the title Upgrade pip to above its broken version Don't call no-download on virtualenv, so it installs latest pip. Jan 29, 2020
@ericholscher ericholscher changed the title Don't call no-download on virtualenv, so it installs latest pip. Fix issue with pip 20.0 breaking on install Jan 29, 2020
@agjohnson agjohnson added the PR: hotfix label Jan 29, 2020
Copy link
Contributor

@agjohnson agjohnson left a comment

👍

@agjohnson agjohnson merged commit 4c8da2f into master Jan 29, 2020
3 checks passed
@agjohnson agjohnson deleted the no-broken-pip branch Jan 29, 2020
agjohnson pushed a commit that referenced this issue Jan 29, 2020
* Upgrade pip to above its broken version

* Call virtualenv without no-download

* Add comment

* link to issue: #6585
@humitos humitos restored the no-broken-pip branch Jan 29, 2020
@humitos humitos deleted the no-broken-pip branch Jan 29, 2020
@LarryOltmanns
Copy link

@LarryOltmanns LarryOltmanns commented Feb 1, 2020

Removed all Python installations, including down loader. Then installed Python 3.7.4 64 bit includes installer. Ran commands - to use python it works. Now with dwave-ocean

@LarryOltmanns
Copy link

@LarryOltmanns LarryOltmanns commented Feb 1, 2020

py -m pip --version
pip 9.0.1 from c:\python36\lib\site-packages (Python 3.6.1)
You can make sure that pip is up-to-date by running:

py -m pip install --upgrade pip

@LarryOltmanns
Copy link

@LarryOltmanns LarryOltmanns commented Feb 1, 2020

Windows cmd.exe
py -m pip install --upgrade pip
(this removes the 19.2.3 and installs 20.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: hotfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants