pip install pyopenssl object has no attribute 'SSL_ST_INIT'
By John Parsons •
I've searched this forum for the same issues and none of the fixes worked for me. I have a Ubuntu 18.04 and any python 2.7 modules that need OpenSSL I get an attribute error. Pip install command always gives attribute error, but a pip freeze command works.
I tried (unsuccessfully) the commands:
pip install -U pyopenssl
rm -rf /usr/lib/python2.7/dist-packages/OpenSSL
rm -rf /usr/lib/python2.7/dist-packages/pyOpenSSL-17.5.0.egg-info
pip install pyopenssl
python2.7 -m pip install --upgrade pip setuptools wheel
easy_install --upgrade pyOpenSSLAny suggestions would be much appreciated!
$ pip install pyopenssl
Traceback (most recent call last): File "/usr/local/bin/pip", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/main.py", line 73, in main command = create_command(cmd_name, isolated=("--isolated" in cmd_args)) File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/__init__.py", line 104, in create_command module = importlib.import_module(module_path) File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 24, in <module> from pip._internal.cli.req_command import RequirementCommand, with_cleanup File "/usr/local/lib/python2.7/dist-packages/pip/_internal/cli/req_command.py", line 16, in <module> from pip._internal.index.package_finder import PackageFinder File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index/package_finder.py", line 21, in <module> from pip._internal.index.collector import parse_links File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index/collector.py", line 14, in <module> from pip._vendor import html5lib, requests 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 "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in <module> File "build/bdist.linux-x86_64/egg/OpenSSL/SSL.py", line 118, in <module>
AttributeError: 'module' object has no attribute 'SSL_ST_INIT'Example of a command needing OpenSSL
$ openstack
Traceback (most recent call last): File "/usr/bin/openstack", line 6, in <module> from openstackclient.shell import main File "/usr/lib/python2.7/dist-packages/openstackclient/shell.py", line 22, in <module> from osc_lib.api import auth File "/usr/lib/python2.7/dist-packages/osc_lib/api/auth.py", line 19, in <module> from keystoneauth1.loading import base File "/usr/lib/python2.7/dist-packages/keystoneauth1/loading/__init__.py", line 13, in <module> from keystoneauth1.loading import adapter File "/usr/lib/python2.7/dist-packages/keystoneauth1/loading/adapter.py", line 13, in <module> from keystoneauth1 import adapter File "/usr/lib/python2.7/dist-packages/keystoneauth1/adapter.py", line 16, in <module> from keystoneauth1 import session File "/usr/lib/python2.7/dist-packages/keystoneauth1/session.py", line 25, in <module> import requests File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 95, 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 "build/bdist.linux-x86_64/egg/OpenSSL/__init__.py", line 8, in <module> File "build/bdist.linux-x86_64/egg/OpenSSL/SSL.py", line 118, in <module>
AttributeError: 'module' object has no attribute 'SSL_ST_INIT' 1 Answer
The below command did the trick.
python2.7 -m easy_install --upgrade pyOpenSSL More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"