question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Broken pipenv after update: AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

See original GitHub issue

After:

$ sudo pip install -U pipenv
...
ackages (from pew>=0.1.26->pipenv)
Installing collected packages: pew, pipenv
  Found existing installation: pew 0.1.26
    Uninstalling pew-0.1.26:
      Successfully uninstalled pew-0.1.26
  Found existing installation: pipenv 8.2.5
    Uninstalling pipenv-8.2.5:
      Successfully uninstalled pipenv-8.2.5
Successfully installed pew-0.1.27 pipenv-8.2.6

I couldn’t use pipenv:

$ pipenv shell
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python2.7/dist-packages/pipenv/__init__.py", line 17, in <module>
    from .cli import cli
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 21, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/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'
$ pipenv --jumbotron
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 7, in <module>
    from pipenv import cli
  File "/usr/local/lib/python2.7/dist-packages/pipenv/__init__.py", line 17, in <module>
    from .cli import cli
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 21, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/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'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
eduzencommented, Oct 6, 2017

I uninstalled requests and pipenv and then I reinstalled both, but the problem still happening. I did some research and I found that the problem was pyOpenSSL. I remove that lib and reinstalled: sudo pip install -U pyOpenSSL Now pipenv works!

0reactions
fogfishcommented, Mar 12, 2018

We are getting exactly same issue with pipenv-11.6.0

pipenv --three install
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 1063, in invoke
    Command.invoke(self, ctx)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/vendor/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pipenv/cli.py", line 62, in cli
    from . import core
  File "/usr/local/lib/python2.7/dist-packages/pipenv/core.py", line 22, in <module>
    import requests
  File "/usr/local/lib/python2.7/dist-packages/pipenv/../requests/__init__.py", line 84, in <module>
    from urllib3.contrib import pyopenssl
  File "/usr/local/lib/python2.7/dist-packages/pipenv/../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'

Uninstall of pyOpenSSL seems to solve the issue but I am not suer if this is a right way to solve it.

pip uninstall -y pyOpenSSL
...
Successfully uninstalled pyOpenSSL-0.15.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

'module' object has no attribute 'SSL_ST_INIT' - Stack Overflow
I couldn't uninstall or upgrade. AttributeError: 'module' object has no attribute 'SSL_ST_INIT'. Following worked for me. # rm -rf /usr ...
Read more >
Advanced Usage of Pipenv - Python Packaging Authority
Dependencies of wheels provided in a Pipfile will not be captured by $ pipenv lock . There are some known issues with using...
Read more >
Python tox doesn't build anymore - Feedback & Bug Reports
I have a python test suite running with tox and since this morning ... AttributeError: module ... has no attribute 'CPython3macOsFramework'.
Read more >
AttributeError: 'module' object has no attribute 'SSL_ST_INIT ...
Some python scripts and other programs are throwing this error from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
Read more >
Debian Bug report logs - #941447 pipenv: AttributeError when ...
Subject: pipenv: AttributeError when running 'pipenv check' ... line 52, in check AttributeError: module 'pip' has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found