0

I don't know what just happened or what I did. It suddenly just can't install the python packages/modules when I tried to install them.

I am using a macbook pro laptop. I have been using virtual environment, there were no problems until now. I tried these in my terminal while I'm on the virtual environment:

pip install pandas
pip install mezzanine
pip install django

and I always received this message. enter image description here

I tried to uninstall virtualenv, pip, and used pip3, but nothing works. On the other hand, I tried installing those packages/modules without using the virtual environment, and everything went well.

I have two python versions, the python3 and python2.

Does it matter to know which python version is pip using? (I THINK YES?!)

I CREATED A VIRTUAL ENVIRONMENT USING PIP, IT CREATED A VIRTUAL ENVIRONMENT WITH PYTHON 2 VERSION INSTALLED, BUT WHEN ASKED TYPE THIS IN THE TERMINAL:

pip --version

WHAT CAME OUT WAS THAT IT'S ON PYTHON 3.6

pip 10.0.0 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip (python 3.6)

FOR MORE INFO:

ll --> name of virtual environment: python 2 version used

Python2:

/Users/macintosh/Documents/ll/bin/python2

Python 3:

/Library/Frameworks/Python.framework/Versions/3.6/bin/python3

This did not happened before. I can use "pip install [module name]" without any problem like this before. I don't know what happened. So, I can't fix it. My last resort is to format everything in my laptop which is sad. Please help thanks.

Community
  • 1
  • 1
RF_956
  • 329
  • 2
  • 7
  • 18
  • 1
    Possible duplicate of [pip install fails with "connection error: \[SSL: CERTIFICATE\_VERIFY\_FAILED\] certificate verify failed (\_ssl.c:598)"](https://stackoverflow.com/questions/25981703/pip-install-fails-with-connection-error-ssl-certificate-verify-failed-certi) – cowbert Apr 16 '18 at 17:45
  • Can you please explain it sir? I do not understand. Sorry I am not well knowledgeable about this. Thank you sir – RF_956 Apr 17 '18 at 05:54
  • Your `pip` has lost the ability to verify SSL certificates. Common causes include an update of OS X where python doesn't know where the cacert bundle is located anymore or you are connecting through a corporate proxy/firewall that uses its own certificate so it can decrypt all the traffic. You can bypass the SSL checking by adding `--trusted-host` flag to pip. This leaves you vulnerable to malware injection though, so best to fix your SSL issues. – cowbert Apr 17 '18 at 15:07

5 Answers5

2

from official

if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.

upgrade pip by

On Linux or macOS:

pip install -U pip
Roushan
  • 4,074
  • 3
  • 21
  • 38
2

Maybe too late but in my case I had to create a new virtualenv with:

python -m virtualenv <virtual_env_venv>

then (after activating it) I was able to do a successful installation in the new virtualenv

pacocampo
  • 66
  • 1
  • 4
1

Use a terminal and write this code:

python -m install [module name]

Use this code without keys and replace the module name ,your preference module.

Kostas Drak
  • 3,222
  • 6
  • 28
  • 60
1

This line worked for installing in my python virtual environment:

python -m pip install [module name]
rithrian
  • 11
  • 1
0

I was using windows command prompt, it was showing the same error. Then I tried installing libraries in the virtual environment using anaconda prompt. It was working

Anusha
  • 1