2

After a fresh install of python3 and python-pip I get this when I try to do anything with pip.

fran@fran:~$ pip -v
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    from pip import main
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 13, in <module>
    from pip.exceptions import InstallationError, CommandError, PipError
  File "/usr/lib/python2.7/dist-packages/pip/exceptions.py", line 6, in <module>
    from pip._vendor.six import iteritems
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 64, in <module>
    vendored("cachecontrol")
  File "/usr/lib/python2.7/dist-packages/pip/_vendor/__init__.py", line 36, in vendored
    __import__(modulename, globals(), locals(), level=0)
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/__init__.py", line 9, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in <module>
  File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 3, in <module>
  File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/__init__.py", line 53, in <module>
  File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 54, in <module>
  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'

I'm new with python and I'm totally lost. Any idea?

Indent
  • 4,675
  • 1
  • 19
  • 35
FranAguiar
  • 637
  • 3
  • 14
  • 31
  • did you install pyOpenSSL? – ytsejam Nov 09 '17 at 08:25
  • 4
    Possible duplicate of [Python "pip install " is failing with AttributeError: 'module' object has no attribute 'SSL\_ST\_INIT'](https://stackoverflow.com/questions/45188413/python-pip-install-is-failing-with-attributeerror-module-object-has-no-att) – Alperen Nov 09 '17 at 08:28
  • No, I tried to install paramiko, but I get this error. Also, tried the solutions on that question, doesn't work for me – FranAguiar Nov 09 '17 at 08:45

2 Answers2

7

try to install (or reinstall) pyOpenSSL :

pip uninstall pyOpenSSL
pip install pyOpenSSL

try :

sudo apt-get purge python-openssl
sudo apt-get install libffi-dev
sudo pip install pyopenssl
Indent
  • 4,675
  • 1
  • 19
  • 35
1
sudo apt-get purge python-openssl

resolved this for me.

"/usr/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in <module>
SSL_ST_INIT = _lib.SSL_ST_INIT 
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Patz
  • 11
  • 1