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

get-pip.py is triggering a Syntax Error on Python 2.7 #9520

Closed
cclauss opened this issue Jan 26, 2021 · 6 comments
Closed

get-pip.py is triggering a Syntax Error on Python 2.7 #9520

cclauss opened this issue Jan 26, 2021 · 6 comments
Labels
resolution: wrong project Should be reported elsewhere

Comments

@cclauss
Copy link
Contributor

cclauss commented Jan 26, 2021

Environment

  • pip version:
  • Python version: 2.7.6 (Yes, I know it is dead but we are close to being 100% Py3)
  • OS: Pyenv on Ubuntu Focal

Description

F-string in get-pip.py is causing Syntax Error on Py2.

File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmp_iKCpH/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
The command '/bin/sh -c pyenv update && pyenv install 2.7.6' returned a non-zero code: 1
build hook failed! (1)

Expected behavior

How to Reproduce

  1. Get package from '...'
  2. Then run '...'
  3. An error occurs.

Output

Paste the output of the steps above, including the commands themselves and
pip's output/traceback etc.
@w8mej
Copy link

w8mej commented Jan 26, 2021

Reproduced.

% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1883k 100 1883k 0 0 12.0M 0 --:--:-- --:--:-- --:--:-- 12.0M
Traceback (most recent call last):
File "get-pip.py", line 24226, in
main()
File "get-pip.py", line 199, in main
bootstrap(tmpdir=tmpdir)
File "get-pip.py", line 82, in bootstrap
from pip._internal.cli.main import main as pip_entry_point
File "/tmp/tmpLw2oZ7/pip.zip/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax

@kyleian
Copy link

kyleian commented Jan 26, 2021

@cclauss pull from https://bootstrap.pypa.io/2.7/get-pip.py , that's what fixed it for me.

@CraigOpie
Copy link

@cclauss pull from https://bootstrap.pypa.io/2.7/get-pip.py , that's what fixed it for me.

This solved my issue. Thanks!

@uranusjr
Copy link
Member

uranusjr commented Jan 27, 2021

I’ll advise further discussion happen in pypa/get-pip#87 instead.

@uranusjr uranusjr added the resolution: wrong project Should be reported elsewhere label Jan 27, 2021
@cclauss cclauss changed the title get-pip.py is triggering a Syntax Error on Python 2 get-pip.py is triggering a Syntax Error on Python 2.7 Jan 27, 2021
@cclauss
Copy link
Contributor Author

cclauss commented Jan 27, 2021

This usage of an f-string breaks pyenv builds of Python 2.7, 3.4, and 3.5 until pyenv/pyenv#1793 (or similar) is landed and released.

lguohan pushed a commit to sonic-net/sonic-buildimage that referenced this issue Jan 28, 2021
We are hitting the issue as described pypa/pip#9520.
Fix to use get_pip.py from 2.7 repo.

Signed-off-by: Abhishek Dosi <[email protected]>
@Morsmalleo
Copy link

@cclauss pull from https://bootstrap.pypa.io/2.7/get-pip.py , that's what fixed it for me.

This solved it for me :)

@pypa pypa locked as resolved and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: wrong project Should be reported elsewhere
Projects
None yet
Development

No branches or pull requests

6 participants