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

Python 2.7 get-pip.py needs a versioned link now #376

Closed
ursetto opened this issue Feb 16, 2021 · 5 comments
Closed

Python 2.7 get-pip.py needs a versioned link now #376

ursetto opened this issue Feb 16, 2021 · 5 comments

Comments

@ursetto
Copy link

ursetto commented Feb 16, 2021

It seems around January 2021 the unversioned get-pip.py became incompatible with Python 2.7.

Installing pip from https://bootstrap.pypa.io/get-pip.py...
Traceback (most recent call last):
  [...]
  File "/tmp/tmpLaSVe5/pip.zip/pip/_internal/cli/main.py", line 60
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
error: failed to install pip via get-pip.py

To fix this I think the 2.7 URL, https://bootstrap.pypa.io/2.7/get-pip.py needs to be added in the area below, just as in pyenv PR pyenv/pyenv#1793 (commit pyenv/pyenv@189afa8).

GET_PIP_URL="https://bootstrap.pypa.io/2.6/get-pip.py"

@Littelarch
Copy link

Hello. I think I may meet some problem related to this "get-pip.py" problem. I can't create virtualenv with python 2.x. I tried both the python2.7 of system and the python2.7 installed by pyenv but both failed.

Error message is like below:

>>> pyenv virtualenv 2.7.18 test2718

......(skip some message of "Requirement already satisfied")

created virtual environment CPython2.7.17.final.0-64 in 466ms
  creator CPython2Posix(dest=/home/arch/.pyenv/versions/2.7.18/envs/test2718, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, wheel=bundle, setuptools=bundle, via=copy, app_data_dir=/home/arch/.local/share/virtualenv)
    added seed packages: pip==20.3.4, setuptools==44.1.1, wheel==0.36.2
  activators PythonActivator,CShellActivator,FishActivator,PowerShellActivator,BashActivator
ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules For the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.

Installing pip from https://bootstrap.pypa.io/get-pip.py...
ERROR: This script does not work on Python 2.7 The minimum supported Python version is 3.6. Please use https://bootstrap.pypa.io/2.7/get-pip.py instead.
error: failed to install pip via get-pip.py

I'm using ubuntu18 and installed pyenv by pyenv-installer today. And I installed pip by "sudo apt install python-pip". Did I miss something which made this problem?

@melaanya
Copy link

melaanya commented Mar 4, 2021

The same problem as for @Littelarch happens to me in Ubuntu 20

@melaanya
Copy link

melaanya commented Mar 4, 2021

For me the problem was solved after installing more-itertools==5.0.0 instead of 8.0 that was there (in the local environment of 2.7.18)

@jkbhagatio
Copy link

jkbhagatio commented Apr 4, 2021

I had the same issue as @Littelarch when trying to create a 2.7 virtual env with pyenv, and @ursetto 's proposed solution of adding the 2.7 URL as one of the cases in the pyenv-virtualenv file worked for me

@native-api
Copy link
Member

#403

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

No branches or pull requests

5 participants