Unable to import `ssl` module from Linux pvpython binary
When running the pvpython
from the ParaView 5.6 release binary, it is not possible to import the ssl
module:
$ /data/scott/Downloads/ParaViewBinary/ParaView-5.6.0-MPI-Linux-64bit/bin/pvpython
Python 2.7.15 (default, Nov 7 2018, 19:23:20)
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/scott/Downloads/ParaViewBinary/ParaView-5.6.0-MPI-Linux-64bit/lib/python2.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>
Also, it's not possible to work around the issue using modules installed in a virtualenv:
$ virtualenv ssl_venv
Running virtualenv with interpreter /usr/bin/python2
New python executable in /home/scott/ssl_venv/bin/python2
Also creating executable in /home/scott/ssl_venv/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
$ source ssl_venv/bin/activate
(ssl_venv) $ pip install pyopenssl
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.
Collecting pyopenssl
Using cached https://files.pythonhosted.org/packages/01/c8/ceb170d81bd3941cbeb9940fc6cc2ef2ca4288d0ca8929ea4db5905d904d/pyOpenSSL-19.0.0-py2.py3-none-any.whl
Collecting six>=1.5.2 (from pyopenssl)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting cryptography>=2.3 (from pyopenssl)
Using cached https://files.pythonhosted.org/packages/c3/c1/cf8665c955c9393e9ff0872ba6cd3dc6f46ef915e94afcf6e0410508ca69/cryptography-2.6.1-cp27-cp27mu-manylinux1_x86_64.whl
Collecting enum34; python_version < "3" (from cryptography>=2.3->pyopenssl)
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>=2.3->pyopenssl)
Using cached https://files.pythonhosted.org/packages/9d/6f/aea9f5559fb593da07ff34e67513bd62483b45715b4a5f5fae6a0a5792ea/cffi-1.12.2-cp27-cp27mu-manylinux1_x86_64.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.3->pyopenssl)
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>=2.3->pyopenssl)
Using cached 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>=2.3->pyopenssl)
Installing collected packages: six, enum34, pycparser, cffi, asn1crypto, ipaddress, cryptography, pyopenssl
Successfully installed asn1crypto-0.24.0 cffi-1.12.2 cryptography-2.6.1 enum34-1.1.6 ipaddress-1.0.22 pycparser-2.19 pyopenssl-19.0.0 six-1.12.0
(ssl_venv) $ python
Python 2.7.12 (default, Nov 12 2018, 14:36:49)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>>
$ ls -alt /home/scott/ssl_venv/bin/activate_this.py
-rw-rw-r-- 1 scott scott 1137 Apr 3 11:28 /home/scott/ssl_venv/bin/activate_this.py
$ /data/scott/Downloads/ParaViewBinary/ParaView-5.6.0-MPI-Linux-64bit/bin/pvpython
Python 2.7.15 (default, Nov 7 2018, 19:23:20)
[GCC 5.3.1 20160406 (Red Hat 5.3.1-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> venvPath = '/home/scott/ssl_venv/bin/activate_this.py'
>>> execfile(venvPath, dict(__file__=venvPath))
>>>
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/data/scott/Downloads/ParaViewBinary/ParaView-5.6.0-MPI-Linux-64bit/lib/python2.7/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
>>>