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

File "get-pip.py", line 43 #2343

Closed
18665301040 opened this issue Jan 12, 2015 · 11 comments
Closed

File "get-pip.py", line 43 #2343

18665301040 opened this issue Jan 12, 2015 · 11 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@18665301040
Copy link

hello:
I installed python-3.4.2 and run python get-pip.py, system come out this error:

[root@localhost src]# python get-pip.py
  File "get-pip.py", line 43
    _b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
------------------------------

Does anyone knows how to solve that?
thanks!

@ionelmc
Copy link
Contributor

ionelmc commented Jan 12, 2015

I'm pretty sure there some more output after that. Can you paste it all?

@18665301040
Copy link
Author

[root@localhost src]# python get-pip.py
File "get-pip.py", line 43
_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
^
SyntaxError: invalid syntax

@ionelmc
Copy link
Contributor

ionelmc commented Jan 12, 2015

Maybe it got corrupted. Try getting it again from https://bootstrap.pypa.io/get-pip.py

@18665301040
Copy link
Author

Yes, I download from the link, but still comes out the same error.

@18665301040
Copy link
Author

I think something wrong in my system, I install python-3.4.2, but system still show:
[root@localhost src]# python -V

Python 2.4.3

I will check again.

@18665301040
Copy link
Author

hello, i changed to python-3.4.2 and run the command, the system shows a new error:

[root@localhost src]# python get-pip.py
Exception:
Traceback (most recent call last):
  File "/tmp/tmphkuvft0z/pip.zip/pip/basecommand.py", line 232, in main
    status = self.run(options, args)
  File "/tmp/tmphkuvft0z/pip.zip/pip/commands/install.py", line 339, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmphkuvft0z/pip.zip/pip/req/req_set.py", line 235, in prepare_files
    req_to_install, self.upgrade)
  File "/tmp/tmphkuvft0z/pip.zip/pip/index.py", line 305, in find_requirement
    page = self._get_page(main_index_url, req)
  File "/tmp/tmphkuvft0z/pip.zip/pip/index.py", line 783, in _get_page
    return HTMLPage.get_page(link, req, session=self.session)
  File "/tmp/tmphkuvft0z/pip.zip/pip/index.py", line 872, in get_page
    "Cache-Control": "max-age=600",
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/sessions.py", line 473, in get
    return self.request('GET', url, **kwargs)
  File "/tmp/tmphkuvft0z/pip.zip/pip/download.py", line 365, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/cachecontrol/adapter.py", line 43, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 518, in urlopen
    body=body, headers=headers)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 322, in _make_request
    self._validate_conn(conn)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 727, in _validate_conn
    conn.connect()
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/packages/urllib3/connection.py", line 238, in connect
    ssl_version=resolved_ssl_version)
  File "/tmp/tmphkuvft0z/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 254, in ssl_wrap_socket
    return context.wrap_socket(sock)
  File "/usr/local/python3/lib/python3.4/ssl.py", line 364, in wrap_socket
    _context=self)
  File "/usr/local/python3/lib/python3.4/ssl.py", line 535, in __init__
    raise ValueError("check_hostname requires server_hostname, "
ValueError: check_hostname requires server_hostname, but it's not supported by your OpenSSL library
---------------------------------------

Yum broken.

@18665301040
Copy link
Author

hello:
I install openssl and openssl-devel, the system still show this error:

[root@localhost src]# python -V
Python 3.4.2
[root@localhost src]# yum install openssl-devel
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.163.com
Setting up Install Process
Package openssl-devel-0.9.8e-31.el5_11.i386 already installed and latest version
Nothing to do
[root@localhost src]# yum install openssl
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: ftp.sjtu.edu.cn
 * extras: mirrors.btte.net
 * updates: mirrors.163.com
Setting up Install Process
Package openssl-0.9.8e-31.el5_11.i686 already installed and latest version
Nothing to do
[root@localhost src]#
------------------------------------error------------------------------
[root@localhost src]# python get-pip.py
Exception:
Traceback (most recent call last):
  File "/tmp/tmpviuahh9y/pip.zip/pip/basecommand.py", line 232, in main
    status = self.run(options, args)
  File "/tmp/tmpviuahh9y/pip.zip/pip/commands/install.py", line 339, in run
    requirement_set.prepare_files(finder)
  File "/tmp/tmpviuahh9y/pip.zip/pip/req/req_set.py", line 235, in prepare_files
    req_to_install, self.upgrade)
  File "/tmp/tmpviuahh9y/pip.zip/pip/index.py", line 305, in find_requirement
    page = self._get_page(main_index_url, req)
  File "/tmp/tmpviuahh9y/pip.zip/pip/index.py", line 783, in _get_page
    return HTMLPage.get_page(link, req, session=self.session)
  File "/tmp/tmpviuahh9y/pip.zip/pip/index.py", line 872, in get_page
    "Cache-Control": "max-age=600",
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/sessions.py", line 473, in get
    return self.request('GET', url, **kwargs)
  File "/tmp/tmpviuahh9y/pip.zip/pip/download.py", line 365, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/sessions.py", line 573, in send
    r = adapter.send(request, **kwargs)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/cachecontrol/adapter.py", line 43, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/adapters.py", line 370, in send
    timeout=timeout
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 518, in urlopen
    body=body, headers=headers)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 322, in _make_request
    self._validate_conn(conn)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 727, in _validate_conn
    conn.connect()
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/packages/urllib3/connection.py", line 238, in connect
    ssl_version=resolved_ssl_version)
  File "/tmp/tmpviuahh9y/pip.zip/pip/_vendor/requests/packages/urllib3/util/ssl_.py", line 254, in ssl_wrap_socket
    return context.wrap_socket(sock)
  File "/usr/local/python3/lib/python3.4/ssl.py", line 364, in wrap_socket
    _context=self)
  File "/usr/local/python3/lib/python3.4/ssl.py", line 535, in __init__
    raise ValueError("check_hostname requires server_hostname, "
ValueError: check_hostname requires server_hostname, but it's not supported by your OpenSSL library

@liboshi
Copy link

liboshi commented Jan 14, 2015

As far as I know, command yum is based on python 2.x.
When you changed python to version 3.4.2, it will cause yum script cannot be executed normally.
Please make those two versions to coexist on your machine.

-Boush

@dstufft
Copy link
Member

dstufft commented Mar 5, 2015

Pip no longer supports Python 2.4, the ValueError issue is being tracked as #2395.

@dstufft dstufft closed this as completed Mar 5, 2015
@Gemesys
Copy link

Gemesys commented Nov 17, 2017

I just installed latest Python 2.7.14 from www.python.org. Built it from source, and have Python working and showing version 2.7.14. It did not include or build pip. I downloaded get-pip.py from https://pip.pypa.io/en/stable/installing/#installing-with-get-pip-py, and tried to run: Python get-pip.py, as per instructions - but I got exactly the same error documented here, viz. "SyntaxError: Invalid Syntax" on line 43. Is there a fix for this error, or a workaround? Thanx.

@Gemesys
Copy link

Gemesys commented Nov 17, 2017

Solution: (I realize this is a closed thread - but for those doing google searches to resolve this, let me put the solution I found that worked for us).. We have a bunch of machines running an older Fedora, and the fix for us was, given I had just installed the newer Python 2.7.14 from source and used "make install" (probably better to leave your system default Python alone, and install using "make altinstall"), but I wanted to use python 2.7 as system default. I did a "yum install openssl-devel" to get all the ssl stuff, and then, did a REBOOT of the machine. The reboot was critical. Once rebooted, the "python get-pip.py" command ran, and found all three needed packages, downloaded them, and indicated "pip, wheel, setuptools" were installed successfully. Entering "pip --version" at command shell, indicates pip version 9.0.1 running and using "/usr/local/lib/python2.7/site-packages (python 2.7)".

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

5 participants