Results 1 to 5 of 5

Thread: Python - AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

  1. #1
    Join Date
    2013-Jul
    Posts
    41

    Question Python - AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    Some python scripts and other programs are throwing this error
    Code:
      from OpenSSL.SSL import Error, ZeroReturnError, WantReadError
      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'
    Upon my research, Google is full of post with other users experiencing same error with all types of python scripts. Majority of posts direct user to verify pyOpenSSL version is latest ( Which I've done ) and this fixes most of the users issues.

    I've implemented all suggestions I've found pertaining to this issue, with no luck what so ever.

    Can any one point me in the right direction?

    Here is some info

    Latest version of Kali, updated daily via apt-get
    Code:
    pyOpenSSL==16.2.0
    OpenSSL 1.1.0c  10 Nov 2016
    Python 2.7.13
    Thanks,
    Last edited by hightech316; 2017-01-29 at 18:17.

  2. #2
    Join Date
    2017-Feb
    Posts
    8
    https://github.com/mwrlabs/drozer/pull/241

    So, you need to upgrade PyOpenSSL from 0.15 to 16.2

  3. #3
    Join Date
    2017-Feb
    Posts
    39
    he already have 16.2.0 if you look at his post!

  4. #4
    Join Date
    2016-Mar
    Location
    Visoko, Bosnia
    Posts
    4

    Cool

    I've found this on the github issues site of "OWTF" but it is related to the same problem, someone reported that it wasn't fixed after upgrading pyOpenSSL to 16.2
    so give it a try

    Code:
    pip install virtualenv virtualenvwrapper
    source '/usr/local/bin/virtualenvwrapper.sh'
    echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.zshrc (or ~/.bashrc if use bash)
    mkvirtualenv owtf -p /usr/bin/python2.7
    apt-get update;apt-get upgrade;apt autoremove;apt-get update;apt-get dist-upgrade;
    pip install -U --trusted-host pypi.douban.com -i http://pypi.douban.com/simple beautifulsoup4 lxml Markdown pexpect psycopg2 pyOpenSSL PyVirtualDisplay rdflib selenium six SQLAlchemy tornado
    I know that this is not a clean solution, but I don't know which package fixed it.

  5. #5
    Join Date
    2013-Jul
    Posts
    41
    Quote Originally Posted by vu4rac0d3 View Post
    I've found this on the github issues site of "OWTF" but it is related to the same problem, someone reported that it wasn't fixed after upgrading pyOpenSSL to 16.2
    so give it a try

    Code:
    pip install virtualenv virtualenvwrapper
    source '/usr/local/bin/virtualenvwrapper.sh'
    echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.zshrc (or ~/.bashrc if use bash)
    mkvirtualenv owtf -p /usr/bin/python2.7
    apt-get update;apt-get upgrade;apt autoremove;apt-get update;apt-get dist-upgrade;
    pip install -U --trusted-host pypi.douban.com -i http://pypi.douban.com/simple beautifulsoup4 lxml Markdown pexpect psycopg2 pyOpenSSL PyVirtualDisplay rdflib selenium six SQLAlchemy tornado
    I know that this is not a clean solution, but I don't know which package fixed it.
    Thanks for the replies.

    When attempting to do what you have suggested, I immediately run into an error while running

    Code:
    pip install virtualenv virtualenvwrapper
    Code:
     pip install virtualenv virtualenvwrapper
    Requirement already satisfied: virtualenv in /usr/lib/python3/dist-packages
    Collecting virtualenvwrapper
      Using cached virtualenvwrapper-4.7.2.tar.gz
    Could not import setuptools which is required to install from a source distribution.
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 387, in setup_py
        import setuptools  # noqa
      File "/usr/share/python-wheels/setuptools-32.3.1-py2.py3-none-any.whl/setuptools/__init__.py", line 10, in <module>
        from setuptools.extern.six.moves import filter, filterfalse, map
      File "/usr/share/python-wheels/setuptools-32.3.1-py2.py3-none-any.whl/setuptools/extern/__init__.py", line 1, in <module>
        from pkg_resources.extern import VendorImporter
    ImportError: No module named 'pkg_resources.extern'
    I then did some research the error aboveCould not import setuptools . Which many posts suggest to reinstall / upgrade setuptools, Where I also ran into another issue

    Code:
    pip install -U setuptools              
    Requirement already up-to-date: setuptools in ./dist-packages
    Requirement already up-to-date: six>=1.6.0 in /usr/lib/python3/dist-packages (from setuptools)
    Requirement already up-to-date: appdirs>=1.4.0 in ./dist-packages (from setuptools)
    Requirement already up-to-date: packaging>=16.8 in ./dist-packages (from setuptools)
    Requirement already up-to-date: pyparsing in /usr/lib/python3/dist-packages (from packaging>=16.8->setuptools)
    All seems well and up to date.... I've never had so many issues with python, and running into problem after problem. Looks like I need to do some more reading involving setuptools

    I have recently switched to Oh My Zsh , Could this of been the causing these issues?


    Once again, appreciate all the feedback.

Similar Threads

  1. Replies: 0
    Last Post: 2014-04-18, 05:46
  2. Python and IDLE
    By sark_89 in forum General Archive
    Replies: 1
    Last Post: 2014-04-02, 10:32
  3. Failed to load module "canberra-gtk-module"
    By kal in forum TroubleShooting Archive
    Replies: 1
    Last Post: 2013-12-08, 13:28

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •