pip install cryptography fails with a proxy error - python-2.7

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!

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.

Installing request module in python 2.7 windows 10

I have installed python 2.7,added the path in environment variables trying to import requests module in python IDLE.
To install requests module i am trying to use
python -m pip install requests
but i am getting error
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x040C7530>, 'Connection to pypi.python.org timed out. (connect timeout=15)')': /simple/requests/
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
please help me what can i do
This answer won't tell you why you are getting that error, but suggests a workaround at the end.
Just a wild guess but perhaps the error is caused by not having the correct version of pip?
Python : ImportError: No module named requests

Plotly installation fails to establish new connection

I usually use a proxy at my workplace such that I have:
C:\myPath>echo %https_proxy%
http://myUser:myPassword#myProxy:myPort
Now I am at home (it means.. no proxy!) and I am trying to install a package ("plotly"):
C:\myPath>conda install -c plotly plotly=1.3.2
Fetching package metadata ...
CondaHTTPError: HTTP None None
for url <None>
An HTTP error occurred when trying to retrieve this URL.
ProxyError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /plot
ly/win-64/repodata.json (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<requests.packages.urllib3
.connection.VerifiedHTTPSConnection object at 0x0000000004D786A0>: Failed to establish a new connection: [Errno 11004] g
etaddrinfo failed',)))",),)
In order to remove the proxy settings without removing the environment variables I tried:
set http_proxy = ""
set https_proxy= ""
but the situation does not change.
I have also tried:
C:\myPath>pip install plotly
Collecting plotly
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProxyError('Cannot conne
ct to proxy.', NewConnectionError('<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0
x0000000003C6C400>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',))': /simple/plotly/
The questions are:
- is the problem my proxy settings?
- if it is, how can I change them?
I have solved in a very simple way. The mistake was in the way I removed the proxy. I set:
C:\myPath>set https_proxy=
and the command
C:\myPath>conda install -c plotly plotly=1.3.2
worked!
WARNING: the commands http(s)_proxy= have to contain no blank spaces.