-1

After updating to Ubuntu 18.04 LTS I can no longer use most Python apps including pip (to install or uninstall). I get the following error in command-line:

Traceback (most recent call last):  
  File "/usr/local/bin/pip", line 11, in <module> load_entry_point('pip==10.0.1', 'console_scripts', 'pip')()  

  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 572, in load_entry_point  

  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2755, in load_entry_point  

  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2408, in load  

  File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2414, in resolve  

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 42, in <module>  
    from pip._internal import cmdoptions

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cmdoptions.py", line 16, in <module>
    from pip._internal.index import (  

  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 15, in <module>
    from pip._vendor import html5lib, requests, six

  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py", line 86, 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/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import rand, crypto, SSL

  File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 105, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT

AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

After Googling the errors it appears that the version of pyopenssl is out of date, but I've tried to manually download an installpyopenssl18 through a TGZ file or through easy_install and neither have worked.

I cannot install/uninstall via pip because I get the above error. Any suggestions? I'd like to avoid having to reinstall Python or even the OS itself.

Paul Rooney
  • 20,879
  • 9
  • 40
  • 61

1 Answers1

0

After trying the manual install of pyopenssl 18 again I noticed the path it was installing to: /usr/local/lib/python2.7/dist-packages

So I went digging in that directory and saw a folder called:

OpenSSL

which was referenced in the error. I renamed this folder and re-installed pyopenssl and the error is cleared. I don't have any issues accessing HTTPS sites so it is possible this is a deprecated module replaced by pyOpenSSL?