简体   繁体   中英

Unable to install packages with pip (SSL: CERTIFICATE_VERIFY_FAILED)

I've been unable to download any package with pip and I keep getting the same error about a problem confirming the SSL certificate. I'm currently on my university's network and I also have Anaconda installed on my laptop. I'm not sure if those two factors have anything to do with this issue.

I am using python version 3.7.0 , pip version 9.0.1 and pip3 version 10.0.1 .

When I type pip install django in the terminal I get this result:

Collecting django
  Could not fetch URL https://pypi.python.org/simple/django/:
     There was a problem confirming the ssl certificate: 
     [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749)
     - skipping
  Could not find a version that satisfies the requirement django (from versions: )
No matching distribution found for django

I've read several other threads. I've tried commands such as these without success:

curl https://bootstrap.pypa.io/get-pip.py | python3
pip install --upgrade pip
pip install --trusted-host pypi.org --trusted-host \
  files.pythonhosted.org django

According to this issue you should also add pypi.python.org to the command line as a trusted host, ie:

pip install --trusted-host pypi.org --trusted-host pypi.python.org \
            --trusted-host files.pythonhosted.org django

I faced similar issue the solution worked for me is by adding three path to environment variables

C:\Anaconda3; 

C:\Anaconda3\Scripts; 

C:\Anaconda3\Library\bin;

I had been using python 3.7.1 with anaconda 4.8.2 on window 7. You may check for missing path environment variable and add only the missing ones.

Open Anaconda prompt and run the following:

conda install -f pip

pip install pandas

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM