Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run error: "'module' object has no attribute 'SSL_ST_INIT'"." #15260

Closed
patrickrbecker opened this issue Mar 4, 2017 · 27 comments
Closed

Run error: "'module' object has no attribute 'SSL_ST_INIT'"." #15260

patrickrbecker opened this issue Mar 4, 2017 · 27 comments

Comments

@patrickrbecker
Copy link

patrickrbecker commented Mar 4, 2017

Hey everyone, after installation trying to run the gui yields:

# ./w3af_gui Something went wrong, w3af failed to start the output manager. Exception: "There was an error while importing w3af.plugins.output.console: "'module' object has no attribute 'SSL_ST_INIT'"."

Trying to run the console:

# ./w3af_console Traceback (most recent call last): File "./w3af_console", line 15, in <module> from w3af.core.ui.console.console_ui import ConsoleUI File "/root/w3af/w3af/core/ui/console/console_ui.py", line 35, in <module> from w3af.core.ui.console.rootMenu import rootMenu File "/root/w3af/w3af/core/ui/console/rootMenu.py", line 32, in <module> from w3af.core.ui.console.plugins import pluginsMenu File "/root/w3af/w3af/core/ui/console/plugins.py", line 29, in <module> from w3af.core.ui.console.config import ConfigMenu File "/root/w3af/w3af/core/ui/console/config.py", line 27, in <module> from w3af.core.controllers.plugins.plugin import Plugin File "/root/w3af/w3af/core/controllers/plugins/plugin.py", line 37, in <module> from w3af.core.data.url.helpers import new_no_content_resp File "/root/w3af/w3af/core/data/url/helpers.py", line 28, in <module> import OpenSSL 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 118, in <module> SSL_ST_INIT = _lib.SSL_ST_INIT AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

Machine information:

# uname -a Linux 4.9.0-kali2-amd64 #1 SMP Debian 4.9.13-1kali1 (2017-03-01) x86_64 GNU/Linux

Dependency check:

# . /tmp/w3af_dependency_install.sh Requirement already satisfied: pyOpenSSL==0.15.1 in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: pyasn1==0.1.9 in /usr/local/lib/python2.7/dist-packages Requirement already satisfied: six>=1.5.2 in /usr/lib/python2.7/dist-packages (from pyOpenSSL==0.15.1) Requirement already satisfied: cryptography>=0.7 in /usr/local/lib/python2.7/dist-packages (from pyOpenSSL==0.15.1) Requirement already satisfied: setuptools>=11.3 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: ipaddress in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: enum34 in /usr/lib/python2.7/dist-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: idna>=2.0 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: cffi>=1.4.1 in /usr/local/lib/python2.7/dist-packages (from cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: appdirs>=1.4.0 in /usr/local/lib/python2.7/dist-packages (from setuptools>=11.3->cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: packaging>=16.8 in /usr/local/lib/python2.7/dist-packages (from setuptools>=11.3->cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: pycparser in /usr/local/lib/python2.7/dist-packages (from cffi>=1.4.1->cryptography>=0.7->pyOpenSSL==0.15.1) Requirement already satisfied: pyparsing in /usr/lib/python2.7/dist-packages (from packaging>=16.8->setuptools>=11.3->cryptography>=0.7->pyOpenSSL==0.15.1)

` pip freeze
Warning: cannot find svn location for chirp===daily-20170124
adns-python==1.2.1
AdvancedHTTPServer==2.0.5
alembic==0.8.8.dev0
anyjson==0.3.3
appdirs==1.4.2
argcomplete==1.8.1
argh==0.26.2
attrs==16.3.0
backports-abc==0.5
backports.shutil-get-terminal-size==1.0.0
backports.ssl-match-hostname==3.5.0.1
basemap==1.0.7
BBQSQL==1.0
BeautifulSoup==3.2.1
beautifulsoup4==4.5.3
BlindElephant==1.0
blinker==1.3
boltons==16.4.1
brotlipy==0.6.0
capstone==3.0.4
certifi==2016.2.28
cffi==1.9.1
chardet==2.1.1
Cheetah==2.4.4

FIXME: could not find svn URL in dependency_links for this package:

chirp===daily-20170124
click==6.6
cluster==1.1.1b3
colorama==0.3.7
ConfigArgParse==0.11.0
configobj==5.0.6
configparser==3.3.0.post2
constantly==15.1.0
construct==2.5.2
couchdbkit==0.6.5
cryptography==1.7.2
cssutils==1.0
cycler==0.10.0
dap==2.2.6.7
darts.util.lru==0.5
decorator==4.0.11
dicttoxml==1.7.4
dissy==9
distorm3==3.3.4
dnspython==1.15.0
docutils==0.13.1
easygui==0.96
EasyProcess==0.2.3
Elixir==0.7.1
enum34==1.1.6
esmre==0.3.1
feedparser==5.1.3
Flask==0.10.1
FormEncode==1.3.0
functools32==3.2.3.post2
fuse-python==0.2.1
future==0.15.2
futures==2.1.5
fuzzywuzzy==0.15.0
GDAL==2.1.2
GeoIP==1.3.2
geoip2==2.4.2
geojson==1.3.1
gevent==1.1.2
gitdb==0.6.4
gitdb2==2.0.0
GitPython==0.3.2rc1
greenlet==0.4.11
guess-language==0.2
h2==2.5.2
halberd==0.2.4
hpack==2.3.0
html2text==2016.9.19
html5lib==0.999999999
http-parser==0.8.3
httplib2==0.9.2
httpretty==0.8.14
hyperframe==4.0.1
icalendar==3.8
idna==2.4
impacket==0.9.15
incremental==16.10.1
ipaddress==1.0.18
iptools==0.6.1
IPy==0.83
ipython==5.1.0
ipython-genutils==0.1.0
itsdangerous==0.24
jdcal==1.0
Jinja2==2.7.3
jsbeautifier==1.6.4
jsonpickle==0.9.3
jsonrpclib==0.1.3
keepnote==0.7.8
keyring==10.1
keyrings.alt==1.3
killerbee==1.0
lxml==3.4.4
M2Crypto==0.24.0
Mako==1.0.6
Markdown==2.6.1
MarkupSafe==0.23
matplotlib==2.0.0
maxminddb==1.2.3
mechanize==0.2.5
mercurial==4.0
metaconfig==0.1.4a1
mitmproxy==0.13
mockito==0.5.2
msgpack-python==0.4.4
mysqlclient==1.3.7
nassl==0.12
ndg-httpsclient==0.3.3
netaddr==0.7.18
netlib==0.13.1
NfSpy==1.0
nltk==3.0.1
numpy==1.12.0
olefile==0.42.1
openpyxl==2.3.0
packaging==16.8
PAM==0.4.2
paramiko==2.0.0
passlib==1.7.0.post20161128115349
Paste==2.0.3
PasteDeploy==1.5.2
PasteScript==1.7.5
pathlib2==2.1.0
pathtools==0.1.2
pcapy==0.10.8
pdfminer==20140328
pefile==2016.3.28
pexpect==4.2.1
phply==0.9.1
pickleshare==0.7.4
Pillow==4.0.0
pluginbase==0.4
ply==3.10
prettytable==0.7.2
prompt-toolkit==1.0.9
psutil==2.2.1
psycopg2==2.6.2
ptyprocess==0.5.1
py==1.4.32
pyasn1==0.1.9
pyasn1-modules==0.0.7
pybloomfilter==1.0
pybloomfiltermmap==0.3.14
pyClamd==0.3.15
pycparser==2.17
pycrypto==2.6.1
pycurl==7.43.0
PyDispatcher==2.0.5
pydns==2.3.6
pyenchant==1.6.7
PyGithub==1.21.0
Pygments==2.2.0
pygobject==3.22.0
pygraphviz==1.4rc1
pyinotify==0.9.6
pylibemu==0.3.3
pymongo==3.4.0
pymssql==1.0.2
pyOpenSSL==0.15.1
pyotp==2.2.1
pyparsing==2.1.10
PyPDF2==1.26.0
pyperclip==1.5.27
pyrit==0.5.1
pyscard==1.9.4
pyserial==3.2.1
pysnmp==4.3.2
pysnmp-apps==0.3.2
pysnmp-mibs==0.1.3
PySocks==1.6.5
pyspatialite==3.0.1
pysqlite==2.7.0
pytest==3.0.6
python-apt==1.4.0b2
python-dateutil==2.5.3
python-debian==0.1.30
python-debianbts==2.6.1
python-editor==0.4
python-Levenshtein==0.12.0
python-ntlm==1.0.1
python-openid==2.2.5
python-pam==1.8.2
python-qt-binding==0.2.17
pytz==2016.7
pyusb==1.0.0b2
PyVirtualDisplay==0.2.1
PyX==0.12.1
pyxdg==0.25
PyYAML==3.12
qrcode==5.3
qt4reactor==1.6
rdpy==1.3.2
reportbug==6.6.6
requests==2.12.4
requests-file==1.4.1
restkit==4.2.2
rfidiot==1.0
roman==2.0.0
rsa==3.4.2
ruamel.ordereddict==0.4.8
scapy===unknown.version
scapy-real==2.2.0.dev0
scgi==1.13
SecretStorage==2.3.1
selenium==3.0.2
service-identity==16.0.0
Shapely==1.5.17
simplegeneric==0.8.1
simplejson==3.10.0
singledispatch==3.4.0.3
six==1.10.0
slowaes==0.1a1
smmap==0.9.0
smmap2==2.0.1
smoke-zephyr==1.0.2
socketpool==0.5.3
SQLAlchemy==1.0.15
subprocess32==3.2.7
tblib==0.2.0
tcpwatch==1.3.1
Tempita==0.5.2
termcolor==1.1.0
tldextract==1.7.2
tornado==4.4.2
traitlets==4.3.1
Twisted==16.6.0
typing==3.5.2.2
tzlocal==1.3
unicodecsv==0.14.1
urllib3==1.19.1
urwid==1.3.1
uTidylib==0.3
vinetto==0.7b0
volatility==2.6
vulndb==0.0.19
wafw00f==0.9.3
wapiti==2.3.0
watchdog==0.8.3
wcwidth==0.1.7
webencodings==0.5
webunit==1.3.10
Werkzeug==0.11.15
wfuzz==0.0.0
Whoosh==2.7.0
wxPython==3.0.2.0
wxPython-common==3.0.2.0
xdot==0.6
XlsxWriter==0.9.6
xmlbuilder==1.0
yara-python==3.5.0
zenmap==7.40
zim==0.65
zope.interface==4.3.2
`

The issue posted here was very similar to mine but I've not been able to resolve it:
#14895

I tried commenting out the dependency check out of the w3af_gui which was also not successful:
#from w3af.core.ui.gui.dependency_check.dependency_check import dependency_check #dependency_check()

Please let me know if there is any information i missed.

@lewisec
Copy link

lewisec commented Mar 6, 2017

The same problem with you.

@patrickrbecker
Copy link
Author

@lewisec have you made any progress on the issue? I have not been able to make any.

@lewisec
Copy link

lewisec commented Mar 8, 2017

@patrickrbecker no,I don't know how to solve the problem

@iLuaCT0
Copy link

iLuaCT0 commented Mar 13, 2017

i GOT THE SOLVE FOR THIS PROBLEM

1:
Exec this cmd
pip uninstall pyOpenSSL

2:
Exec this cmd
pip install pyOpenSSL

3:
Now go to
....XXXX/w3af/w3af/core/controllers/dependency_check/requirements.py
and edit the python file
on line 39 is write:
PIPDependency('OpenSSL', 'pyOpenSSL', '0.15.1'),
Modify it to
PIPDependency('OpenSSL', 'pyOpenSSL', '16.2.0'),
OR
PIPDependency('OpenSSL', 'pyOpenSSL', 'Version of pyOpenSSL you are using'),

Sorry for my bad english.

@lewisec
Copy link

lewisec commented Mar 18, 2017

@iLuaCT0 Thanks very much! It is done!

@Kuhicop
Copy link

Kuhicop commented Apr 15, 2017

Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 21, in
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/init.py", line 64, in
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.7-py2.py3-none-any.whl/cachecontrol/init.py", line 9, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/init.py", line 52, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 59, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

@Floppyjoe
Copy link

./w3af_console

Traceback (most recent call last):
File "./w3af_console", line 12, in
from w3af.core.controllers.dependency_check.dependency_check import dependency_check
File "/home/me/w3af/w3af/core/controllers/dependency_check/dependency_check.py", line 31, in
import pip
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 21, in
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/init.py", line 64, in
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.7-py2.py3-none-any.whl/cachecontrol/init.py", line 9, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/init.py", line 52, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 59, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

@Floppyjoe
Copy link

Floppyjoe commented Jun 11, 2017

After running "./w3af_console" I got the error in my post above. I had to jump through hoops to get this to work. I had to delete everything the pip installer installed. So you need to find the python.2.7 directory where it gets installed and delete everything in it. I also deleted the contents of a local folder /.cache/pip/wheels/ and I also deleted everything in two local folders /.local/bin and /.local/lib/python2.7/site-packages/. then I deleted my folder /~/w3af.

Then I ran the command "git clone --depth 1 https://github.com/andresriancho/w3af.git" which loads the w3af folder again.

Then I run the command "cd w3af"

Then I edited the file in ~/w3af/w3af/core/controllers/dependency_check/requirements.py and changed
PIPDependency('OpenSSL', 'pyOpenSSL', '0.15.1'), to
PIPDependency('OpenSSL', 'pyOpenSSL', '16.2.0'),

Now I run the command ./w3af_console

It gives me a list of pip files to install:
copy that command and past it into the console but make sure you change the pyOpenssl part like this:

pip install pyClamd==0.3.15 PyGithub==1.21.0 GitPython==0.3.2.RC1 pybloomfiltermmap==0.3.14 esmre==0.3.1 phply==0.9.1 nltk==3.0.1 chardet==2.1.1 tblib==0.2.0 pdfminer==20140328 futures==2.1.5 pyOpenSSL==16.2.0 ndg-httpsclient==0.3.3 lxml==3.4.4 scapy-real==2.2.0-dev guess-language==0.2 cluster==1.1.1b3 msgpack-python==0.4.4 python-ntlm==1.0.1 halberd==0.2.4 darts.util.lru==0.5 Jinja2==2.7.3 vulndb==0.0.19 markdown==2.6.1 psutil==2.2.1 mitmproxy==0.13 ruamel.ordereddict==0.4.8 Flask==0.10.1 PyYAML==3.12 tldextract==1.7.2

When you run this command: "./w3af_console" you may need to fill some dependencies. I had to do these steps over and over until I finally got all the dependencies correct making sure to always change the pyOpenssl to 16.2.0.

When I was done it still complained that I need two dependencies which were installed so I had to comment out two lines in the "w3af_console" file.

This:
from w3af.core.controllers.dependency_check.dependency_check import dependency_check
dependency_check()

becomes this:
#from w3af.core.controllers.dependency_check.dependency_check import dependency_check
#dependency_check()

After all that run around it asks if you accept the terms and installs.

@Martlark
Copy link

Confirm that updating so that pyOpenSSL==16.2.0 , fixes this issue in Flask as well.

@brunotikami
Copy link

@Martlark updating pyOpenSSL==16.2.0 also fixes this for nginx amplify

@jeffdyke
Copy link

I can also confirm that performing the same change as @Floppyjoe makes it work, that was the only pip update i had to make on current master

@laskarbit26
Copy link

i have problem like @Floppyjoe but wheni tyr use command #pip install --upgrade pip ,and than there some massage like this,soory i cant understan because my english sobad,and i am newbie,, anybody help me please

kali@tibraksal:~/w3af# pip install --upgrade pip
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in
from pip import main
File "/usr/lib/python2.7/dist-packages/pip/init.py", line 21, in
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.7/dist-packages/pip/_vendor/init.py", line 64, in
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.7-py2.py3-none-any.whl/cachecontrol/init.py", line 9, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/wrapper.py", line 1, in
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 4, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/init.py", line 52, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 59, in
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/packages/init.py", line 32, in vendored
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/contrib/pyopenssl.py", line 47, in
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/init.py", line 8, in
from OpenSSL import rand, crypto, SSL
File "/usr/local/lib/python2.7/dist-packages/OpenSSL/SSL.py", line 118, in
SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

@alldayi420
Copy link

any progress?...even after doing what dude says still not working

@ashishmadeti
Copy link

The following worked for me:
pip install --upgrade pyOpenSSL

dw added a commit to zatosource/zato that referenced this issue Jan 24, 2018
@matricali
Copy link

@Martlark @brunotikami updating pyOpenSSL==16.2.0 also fixes this for aws-cli

@miqmago
Copy link

miqmago commented Feb 17, 2018

First I had to do this (from certbot/certbot#1968 (comment)):

$ sudo easy_install --upgrade pip
...
Installed /usr/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

$ sudo pip uninstall requests
...
  Successfully uninstalled requests-1.1.0

$ sudo pip install requests
...
Successfully installed requests-2.12.4

$ pip install --upgrade pyOpenSSL

Last line from #15260 (comment) upgraded pyOpenSSL and I could have the fun again

@alldayi420
Copy link

alldayi420 commented Feb 17, 2018 via email

@andresriancho
Copy link
Owner

Solved with the latest merge from develop to master I made today. In order to fix this issue you need to go to your w3af directory and run git pull, then try to run the w3af_console again.

@vhosakot
Copy link

vhosakot commented Mar 8, 2018

I saw the AttributeError: 'module' object has no attribute 'SSL_ST_INIT' error too and sudo pip install pyOpenSSL==16.2.0 resolved it for me!

@tauorus
Copy link

tauorus commented Jun 29, 2018

I uninstalled openssl and then pip works :)
sudo apt remove python-openssl

@contropist
Copy link

rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info
sudo pip install pyopenssl

can solve it.

@PratikSavadi
Copy link

I uninstalled openssl and then pip works :)
sudo apt remove python-openssl

using this it works

@filipecmedeiros
Copy link

rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info
sudo pip install pyopenssl

can solve it.

Thanks, @wmwwmv ! It resolved for me

@shrekee
Copy link

shrekee commented Mar 25, 2019

I uninstalled openssl and then pip works :)
sudo apt remove python-openssl

worked for me! thanks a lot

@theyush
Copy link

theyush commented Jun 16, 2019

root@kali:~/w3af# . /tmp/w3af_dependency_install.sh 
Traceback (most recent call last):
  File "/usr/local/bin/pip", line 6, in <module>
    from pip._internal import main
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/__init__.py", line 40, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/autocompletion.py", line 8, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/main_parser.py", line 12, in <module>
    from pip._internal.commands import (
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/__init__.py", line 6, in <module>
    from pip._internal.commands.completion import CompletionCommand
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/completion.py", line 6, in <module>
    from pip._internal.cli.base_command import Command
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/base_command.py", line 20, in <module>
    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/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 118, in <module>
    SSL_ST_INIT = _lib.SSL_ST_INIT
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

anyone any idea ?

I tried everything mentioned above none of them worked

@hoangdh
Copy link

hoangdh commented Jul 26, 2019

Update your python-openssl and pyopenssl (PIP). I thinking OpenSSL outdate from old OS.
In my case, OS is Ubuntu 14.04

@shdowofdeath
Copy link

rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-0.15.1.egg-info
sudo pip uninstall pyOpenSSL
sudo pip install --upgrade pyOpenSSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests