I installed python 3.6 from source. Python seems working fine but I'm unable to import openssl 1.1.1 (a pre-release that I need to use). I think that there is a path issue but not sure. When I try to import ssl from python, this is the output I get:
~/Downloads/Python-3.6.5$ python3
Python 3.6.5 (default, May 9 2018, 15:43:39)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
Any suggestions?
When I installed openssl, I grabbed the source code then:
./config
sudo make
sudo make install
It seems that openssl has been installed correctly. The output is mostly similar to this path:
/usr/local/share/man/man5/config.5
I then Then uncommented these two lines in Python-3.6.5/Module/Setup.dist
_socket socketmodule.c
And
# Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
Then, When I try to import ssl in python, I get this error:
Python 3.6.5 (default, May 9 2018, 15:43:39)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/ssl.py", line 101, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
Can you please help? What can be the cause of the problem?