pip3.4 issue with SSL certificate but NOT pip - python

I am trying to install libraries for python3.4 using pip in my MacOs X. There is also the python2.7 native version that the system brings. So, this works fine
> pip install numpy
Requirement already satisfied (use --upgrade to upgrade): numpy in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
Cleaning up...
But when I try to install for python3.4
pip3.4 install numpy
I get
Downloading/unpacking numpy
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/numpy/ when looking for
download links for numpy
Could not fetch URL https://pypi.python.org/simple/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/ when looking for download
links for numpy
Cannot fetch index base URL https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/numpy/: There was a
problem confirming the ssl certificate: [SSL: CERTIFICATE_VERIFY_FAILED]
certificate verify failed (_ssl.c:598)
Will skip URL https://pypi.python.org/simple/numpy/ when looking for
download links for numpy
Could not find any downloads that satisfy the requirement numpy
Cleaning up...
No distributions at all found for numpy
I have read that there are problems with the pip version 1.5. In particular
> pip --version
pip 1.2.1 from /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)
while
> pip3.4 --version
pip 1.5 from /Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pip-1.5-py3.4.egg (python 3.4)
Is this my issue? How do I solve it?

If the certificate is not valid, ideally you should import into your system and mark it trusted (if you really trust it) and specify by:
pip --cert file.pem install numpy
Or use --trusted-host parameter, e.g.:
pip --trusted-host https://pypi.python.org/simple/numpy/ install numpy
to mark this host as trusted, even though it does not have valid certificate.
See also: SSL Cert Verification.

Related

How do I set up pypi to trusted?

I am trying to use Python wheels. When I do pip install wheel, it says that the requirement is there, however I get this SSL error:
(base) C:\Users\xxxx\PycharmProjects\prepay_clone>pip install wheel
Requirement already satisfied: wheel in c:\programdata\anaconda3\lib\site-packages (0.33.1)
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(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1056)'))) - skipping
At first I ignored it, since the wheel seems installed. However, when I later run setup.py sdist bdist_wheel, it doesn't output absolutely anything.
Thanks in advance!
To answer your question, the --trusted-host flag tells pip not to bother with SSL for the specified host. I have this problem all the time on a corporate network. I've found this to work 99% of the time:
pip --trusted-host pypi.org --trusted-host files.pythonhosted.org install wheel
I'm not sure if this is your problem though, pip seems to be telling you that wheel is already installed.

Can't install tornado

I am setting up tensorflow and i got this output:
ERROR: matplotlib 1.3.1 requires nose, which is not installed.
so i am doing
sudo easy_install tornado
and i got as output:
earching for tornado
Reading https://pypi.python.org/simple/tornado/
Download error on https://pypi.python.org/simple/tornado/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
Couldn't find index page for 'tornado' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
Download error on https://pypi.python.org/simple/: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590) -- Some packages may not be found!
No local packages or download links found for tornado
error: Could not find suitable distribution for Requirement.parse('tornado')
what should i do?
thanks
francesco
ERROR: matplotlib 1.3.1 requires nose, which is not installed.
It seems that you are running the command behind a proxy or a firewall. If this is the case, then you need to set the corresponding environment variables:
set http_proxy="username:password#host:port"
set https_proxy="username:password#host:port"
Otherwise, you can install tornado using pip by running (if you are not behind a proxy, then ignore --proxy):
pip --proxy http://user:password#proxy-host:port install tornado
EDIT: I would suggest to run
sudo -H pip install --ignore-installed matplotlib
in order to install the required packages and ignore the current version.

SSL: TLSV1_ALERT_PROTOCOL_VERSION

I am very new to Python world, so please be patient with me.
I have a Mac running High Sierra (10.13.4). I installed Python on it and I now have two Python 2.7.10 and 3.6.5
As per my understanding 2.7.10 is default for Mac and I should not tinker with it.
Now, I am trying to connect Python3 to MySQL. I am running following command:
pip install MySQL-python
but facing an error
Collecting MySQL-python3
Could not fetch URL https://pypi.python.org/simple/mysql-python3/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement MySQL-python3 (from versions: )
No matching distribution found for MySQL-python3
I tried the solution provided here
ssl.SSLError: tlsv1 alert protocol version
openssl 1.0.2o_1
pip --version: pip 9.0.1 from /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (python 3.5)
I tried to install virtualenv by running following commend:
sudo pip install virtualenv
but still getting an error:
Could not fetch URL https://pypi.python.org/simple/virtualenv/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement virtualenv (from versions: )
No matching distribution found for virtualenv
Can someone please help me out here? I am trying to find answers my own but have failed so far, so need help.

I can not install the django-constance, with error of Could not find a version that satisfies the requirement django-constance (from versions: )

From the constance docs:
install the constance:
pip install django-constance
But I can not install it, with the error log:
$ pip3 install django-constance
Collecting django-constance
Could not fetch URL https://pypi.python.org/simple/django-constance/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:645) - skipping
Could not find a version that satisfies the requirement django-constance (from versions: )
No matching distribution found for django-constance
Check the python version you are running on e.g. 2.7 or 3.5. Then get an appropriate package version for the respective version you have and install it with pip install package-name==%.%.%where %.%.%Is the package version for your python version. Note that some packages are only released for only python2 while others are for python 3
The following output of your console:
There was a problem confirming the ssl certificate
indicates that there was a network problem while you were trying to install this dependency. It seems like it could be related to this issue:
pip install fails with "connection error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:598)"
solution propesed there was:
You may want to add the trusted hosts and proxy to your config file.
pip.ini (Windows) or pip.conf (unix)
[global]
trusted-host = pypi.python.org
pypi.org
files.pythonhosted.org
I hope that this helps.

pip install issue with ssl certificate:[SSL: TLSV1_ALERT_ACCESS_DENIED]

Pip version:9.0.1
Python version:3.6.3
Operating system:Win7
Description:
I'm trying to install python libraries in my laptop but run into an SSL certificate error when running pip -install for any library. I have tried several suggestions from other posts but all of them didn't work.
Can someone kindly help me to resolve this SSL issue? Thanks in advance.
What I've run:
C:\Users\zhouweiq>pip install requests
Collecting requests
Could not fetch URL https://pypi.python.org/simple/requests/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_ACCESS_DENIED] tlsv1 alert access denied (_ssl.c:777) - skipping
Could not find a version that satisfies the requirement requests (from versions: )
No matching distribution found for requests
I also got the same issue but after configuring proxy it resolved.
Proxy in Windows-> internet options-> connections -> LAN settings.

Categories