Pip Error : 'module' object has no attribute 'Cryptography_HAS_SSL_ST'
Ubuntu 16.04.3 here:
I think I have fixed this by removing the python-openssl package (and it's dependencies) with:
apt-get --auto-remove remove python-openssl
Then installing the latest version with pip:
pip install pyOpenSSL
Of course, if you install another apt package that depends on it, it'll pull it back in. I hope if you use pip for everything you can from now on instead of apt, it should be fine.
Edit: as of January 2019 this issue doesn't seem to exist any more.
Python AttributeError: 'module' object has no attribute 'SSL_ST_INIT'
Turned out the problem was with my installation of pyOpenSSL, pyOpenSSL-0.15.1 .
I did:
pip uninstall pyopenssl
and then
pip install pyopenssl
...and my Python script worked again!
pip3: need attribute 'Cryptography_HAS_SSL_ST'
Try this
cd /usr/local/lib/python3.5/dist-packages
mv OpenSSL/ ~/myOpenSSL
Then you will not observe OpenSSL related issues. I know that it's not solving the root of the problem but at least it will enable you to pip3 to fix the issues. You can revert your OpenSSL back if you don't like this.
after run pip install firebase-admin getting error
I think I have fixed this by removing the python-openssl package (and it's dependencies) with:
apt-get --auto-remove remove python-openssl
Then installing the latest version with pip:
pip install pyOpenSSL
updating python cryptography causes error and does not work scripts
You are modifying your system python installation by using sudo
. That's dangerous and you may have already modified a library that your system depends upon. Use virtualenv or virtualenvwrapper instead.
Here is virtualenvwrapper in action using python2:
brew@ontario:~$ mkvirtualenv -p `which python2` crypto2
Running virtualenv with interpreter /usr/local/bin/python2
New python executable in /Users/brew/.virtualenvs/crypto2/bin/python2.7
Also creating executable in /Users/brew/.virtualenvs/crypto2/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto2/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto2/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto2/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto2/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto2/bin/get_env_details
(crypto2) brew@ontario:~$ pip install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Requirement already up-to-date: pip in ./.virtualenvs/crypto2/lib/python2.7/site-packages (19.2.2)
(crypto2) brew@ontario:~$ pip install cryptography
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting cryptography
Downloading https://files.pythonhosted.org/packages/e2/bf/3b641820c561aedde134e88528ba68dffe41ed238899fab7f7ef20118aaf/cryptography-2.7-cp27-cp27m-macosx_10_6_intel.whl (1.6MB)
|################################| 1.6MB 896kB/s
Collecting enum34; python_version < "3" (from cryptography)
Using cached https://files.pythonhosted.org/packages/c5/db/e56e6b4bbac7c4a06de1c50de6fe1ef3810018ae11732a50f15f62c7d050/enum34-1.1.6-py2-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography)
Downloading https://files.pythonhosted.org/packages/16/f6/46a3dece43541b2cbf3776ec2299e370a2408d9380958401cacb6d101853/cffi-1.12.3-cp27-cp27m-macosx_10_6_intel.whl (245kB)
|################################| 256kB 6.6MB/s
Collecting six>=1.4.1 (from cryptography)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting ipaddress; python_version < "3" (from cryptography)
Downloading https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography)
Installing collected packages: enum34, pycparser, cffi, six, asn1crypto, ipaddress, cryptography
Successfully installed asn1crypto-0.24.0 cffi-1.12.3 cryptography-2.7 enum34-1.1.6 ipaddress-1.0.22 pycparser-2.19 six-1.12.0
(crypto2) brew@ontario:~$ deactivate
brew@ontario:~$
Same thing with python3:
brew@ontario:~$ mkvirtualenv -p `which python3` crypto3
Running virtualenv with interpreter /usr/local/bin/python3
Using base prefix '/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7'
New python executable in /Users/brew/.virtualenvs/crypto3/bin/python3.7
Also creating executable in /Users/brew/.virtualenvs/crypto3/bin/python
Installing setuptools, pip, wheel...
done.
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto3/bin/predeactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto3/bin/postdeactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto3/bin/preactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto3/bin/postactivate
virtualenvwrapper.user_scripts creating /Users/brew/.virtualenvs/crypto3/bin/get_env_details
(crypto3) brew@ontario:~$ pip install --upgrade pip
Requirement already up-to-date: pip in ./.virtualenvs/crypto3/lib/python3.7/site-packages (19.2.2)
(crypto3) brew@ontario:~$ pip install cryptography
Collecting cryptography
Using cached https://files.pythonhosted.org/packages/63/4e/57b7a6bd98906872fcd2531e74b532de2abe17d675a5cf171931fcb4a9e8/cryptography-2.7-cp34-abi3-macosx_10_6_intel.whl
Collecting six>=1.4.1 (from cryptography)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cffi!=1.11.3,>=1.8 (from cryptography)
Using cached https://files.pythonhosted.org/packages/f0/48/5aa4ea664eba26dd5142558d04762f5065c02220b4665b3f7eecb9bb614e/cffi-1.12.3-cp37-cp37m-macosx_10_9_x86_64.whl
Collecting asn1crypto>=0.21.0 (from cryptography)
Using cached https://files.pythonhosted.org/packages/ea/cd/35485615f45f30a510576f1a56d1e0a7ad7bd8ab5ed7cdc600ef7cd06222/asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi!=1.11.3,>=1.8->cryptography)
Installing collected packages: six, pycparser, cffi, asn1crypto, cryptography
Successfully installed asn1crypto-0.24.0 cffi-1.12.3 cryptography-2.7 pycparser-2.19 six-1.12.0
(crypto3) brew@ontario:~$ deactivate
brew@ontario:~$
Getting error while installing scrapy in ubuntu
I think you should update your pip first, then try again.
I see pip==1.5.6
, omg, it's older than the moon
Related Topics
How to Convert Index of a Pandas Dataframe into a Column
Changes in Import Statement Python3
How to Prompt For User Input and Read Command-Line Arguments
How to Push a Subprocess.Call() Output to Terminal and File
Getting Another Program's Output as Input on the Fly
Datastax Python Cassandra Driver Build Fails on Ubuntu
Can't Install Gcloud on Amazon Linux:Invalid Syntax
Saving Stdout from Subprocess.Popen to File, Plus Writing More Stuff to the File
Global Keybinding on X Using Python Gtk3
Find the Similarity Metric Between Two Strings
Loop Through All Nested Dictionary Values
Pandas Read_SQL With Parameters
How to Check the Operating System in Python
How to Parse the Output of /Proc/Net/Dev into Key:Value Pairs Per Interface Using Python
How to Make Python Script Press 'Enter' When Prompted on Shell
A Function Callback Every Time a Key Is Pressed (Regardless of Which Window Has Focus)