Can't install Python 2.7.x using pyenv - python-2.7

I am trying to use pyenv to install Python2.7. It fails, it seems, due to inabilities to download a compatible version of pip. I have already downgraded to pip version 20.3.4, but can't figure out how to tell pyenv this:
pyenv install 2.7.7
Installing openssl-1.0.2k...
Installed openssl-1.0.2k to /Users/username/.pyenv/versions/2.7.7
python-build: use readline from homebrew
Installing Python-2.7.7...
patching file ./Lib/site.py
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
python-build: use tcl-tk from homebrew
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
Installing pip from https://bootstrap.pypa.io/pip/2.7/get-pip.py...
error: failed to install pip via get-pip.py
BUILD FAILED (OS X 12.6.2 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/python-build.20221225200507.60628
Results logged to /var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/python-build.20221225200507.60628.log
Last 10 log lines:
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)': /simple/pip/
/var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/tmpiEoxv0/pip.zip/pip/_vendor/urllib3/util/ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)': /simple/pip/
/var/folders/xl/3b9jpy1x5sq6gr7b_qzw1pkm0000gn/T/tmpiEoxv0/pip.zip/pip/_vendor/urllib3/util/ssl_.py:164: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Certificate did not match expected hostname: pypi.org. Certificate: {'notAfter': 'Aug 27 18:45:09 2023 GMT', 'subjectAltName': (('DNS', 'www.python.org'), ('DNS', '*.python.org'), ('DNS', 'docs.python.org'), ('DNS', 'downloads.python.org'), ('DNS', 'pypi.python.org')), 'subject': ((('commonName', u'www.python.org'),),)}
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(CertificateError("hostname 'pypi.org' doesn't match either of 'www.python.org', '*.python.org', 'docs.python.org', 'downloads.python.org', 'pypi.python.org'",),)) - skipping
ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)
ERROR: No matching distribution found for pip<21.0
I'm on Mac 12.6

Related

Pproblem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443):

so I am using Pycharm 2019.2 with Python 2.7
and I can't download any package.
I have tried:
hard copying packages to Python2.7 directory
pip install urllib3[secure]
pip install --trusted-host=pypi.python.org --trusted-host=pypi.org
--trusted-host=files.pythonhosted.org xlrd
all refused to connect with errors like this:
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/xlrd/
C:\Python27\lib\site-packages\pip-19.0.3-py2.7.egg\pip\_vendor\urllib3\util\ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
InsecurePlatformWarning
in Pycharm, I am getting the following error when trying to install a package:
Could not fetch URL https://pypi.org/simple/geopy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/geopy/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
Proposed Solution:
Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python27\python.exe'.
Everything is working perfectly fine suing python 3.4 but only with 2.7 I'm getting SSL error.
I can't change to 3.4 due to technical reasons at my workplace.
It is an Interpreter Issue. The code was originally written using python 3.7

How to install pip for installing external packages in NAO robot

I have written some code and want to run it on NAO robot, but unfortunately the I used some packages like pygame and boto3 in my code, so now to work this code on NAO I have to install the packages on NAO robot, Can someone please explain the process, please.
I have tried running get-pip.py file on NAO using ssh nao#ip, but it can't install
I have been attempting copying the packages files to NAO, but it also doesn't solve the problem.
I followed the https://community.ald.softbankrobotics.com/ja/node/1506 forum, but it also doesn't solve it
Below is the console output when I run get-pip.py file
PS C:\Users\hp> ssh nao#169.254.252.60 Password: nao [0] ~ $ su Password: root#nao [0] nao # ls Ashim DigiCertHighAssuranceEVRootCA.pem classes.bin diagnosis naoqi recordings DigiCertHighAssuranceEVRootCA.crt angles.bin couples.bin expo.bin rayons.bin remotes root#nao [0] nao # cd Ashim root#nao [0] Ashim # ls boto3 client_secret.json example.py jmespath pip python-engineio six botocore custom-env get-pip.py mpolly.py pygame python-socketio urllib3 root#nao [0] Ashim # python get-pip.py
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. Collecting pip /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/ /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors /tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/connection.py:324: SystemTimeWarning: System time is way off (before 2017-06-30). This will probably lead to SSL verification errors
/tmp/tmpdQ8F7J/pip.zip/pip/_vendor/urllib3/util/ssl_.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:504: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
ERROR: Could not find a version that satisfies the requirement pip (from versions: none)
ERROR: No matching distribution found for pip
root#nao [err 1] Ashim #
Also, I tried to update the system time, but this also not solves the problem. the output remains the same as before:
root#nao [err 127] nao # ntpdate
17 Sep 02:55:02 ntpdate[8986]: no servers can be used, exiting
root#nao [err 1] nao # ntpdate -s 0.de.pool.ntp.org
root#nao [0] nao # ntpdate
11 Jul 10:51:42 ntpdate[9024]: no servers can be used, exiting
root#nao [err 1] nao # cd Ashim
I also tried to install the packages without pip, using sudo python setup.py install
But in this case it shows the error below:
error: could not create '/usr/lib/python2.7/site-packages/awscli-1.16.196-py2.7.egg': No space left on device
You have a:
SystemTimeWarning: System time is way off (before 2017-06-30). This
will probably lead to SSL verification errors
Fix your systemtime otherwise ssl verfication will fail.
It might work similar to pepper, follow the instructions here
You also get the
SNIMissingWarning: An HTTPS request has been made, but the SNI (Server
Name Indication) extension to TLS is not available on this platform.
This may cause the server to present an incorrect TLS certificate,
which can cause validation failures. You can upgrade to a newer
version of Python to solve this. For more information, see
https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
To fix it you would need to install requests[security] package
You can also install packages witout pip as discribed here

Six error while installing utils package on python 2.7 windows XP 32bit [duplicate]

On my cmd window, I typed
pip install pdfminer.six
and it gives me these errors.
Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.
C:\Users\Eric Kim>pip install pdfminer.six
Collecting pdfminer.six
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04435730>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/pdfminer-six/
Retrying (Retry(total=3, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04435870>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/pdfminer-six/
Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04435410>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/pdfminer-six/
Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x044355D0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/pdfminer-six/
Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot connect to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x04435150>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))': /simple/pdfminer-six/
Could not find a version that satisfies the requirement pdfminer.six (from versions: )
No matching distribution found for pdfminer.six
I use Python 3.6 on Windows 10. What should I do? Is there any way that I can install this package without using pip? I want to use this link: https://pypi.python.org/pypi/pdfminer.six/20170720
I'm pretty new to programming, so I don't know much.
This is a proxy problem, as the retry-error-message tells you. Your pip does not connect to the internet through the proxy.
Try pip --proxy url:port pdfminer.six with url:port beeing your proxy, e.g. proxy.example.com:8080.
If this is not working, try using another internet connection without a proxy to install packages via pip, or have a look at this thread, which has more answers regarding pip and proxy.

Getting error while installing pip on Windows 10

I am not a Windows user, I have got Windows 10 computer for testing I am trying to install pip but I am getting this error:
C:\Python27\Lib>python C:\Python27\get-pip.py
Collecting pip
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)': /simple/pip/
c:\users\lattep~1\appdata\local\temp\tmpglpkrn\pip.zip\pip\_vendor\urllib3\util\ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLError(1, '_ssl.c:499: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version'),)) - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
I have manually installed urllib3 and setuptools that got into site-packages, so I tested:
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib3
>>> import setuptools
>>>
and I can import but cannot install pip still.

pip install cryptography fails with a proxy error

Python version = 2.7.13
OS version = Windows 7
I am behind a corporate proxy, trying to install paramiko and crypotagrphy. I searched for a solution but none worked. I tried the following so far to no use.
**Tried setting the proxy variable on windows.
Tried installing urllib3.
Also tried creating a pip folder with a pip.ini file and pasted my proxy address there.
I get the following error when using
pip install --proxy=http:// crytography
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec
tion broken by 'ProxyError('Cannot connect to proxy.', error('Tunnel connection
failed: 405 Method Not Allowed',))': /simple/cryptography/
Any help would be appreciated.
Thanks!