I uninstalled some python packages in ubuntu using sudo pip uninstall packagename
and after that my pip got corrupted. When I do pip -V
its showing this
from pip._internal.download import PipSession
File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 15, in <module>
from pip._vendor import requests, six, urllib3
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 97, in <module>
from pip._vendor.urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
The first thing I did to solve this problem is to reinstall pip itself so I did
sudo apt remove python-pip --purge
sudo apt install python-pip
But pip -V
gives the same error. So I then again completely removed pip without reinstalling sudo apt remove python-pip --purge; sudo apt autoremove
.
Now I have completely purged pip from my system but even after this when I did pip -V
I am getting same error?