Install gcc (yum install gcc) because no GCC is unable to compile and install Python3.6
: https://www.python.org/ftp/python/
1 tar zxvf python-3.5.2.tgz
2 CD Python-3.5.2
3./configure--prefix=/usr/local/python35
4 Make && make install
Then install PIP3 and then use PIP3 to install the package when you encounter:
PIP is configured with locations that require TLS/SSL and however the SSL module in Python are not available.
Workaround:
# Rpm-aq|grep OpenSSL
1). Yum Install Openssl-devel-y
Yum Install OpenSSL
Yum Libssl-dev
2).
#修改Setup文件
Vi/usr/software/python-2.7.5/modules/setup
#修改结果如下:
# Socket Module Helper for Socket (2)
_socket socketmodule.c timemodule.c
# Socket Module helper for SSL support; You must comment out of 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
3). Recompile the installation Python3
. /configure --enable-optimizations
make altinstall
4). The package can be installed normally with PIP3.
Up vote4down vote |
I ran into the same error when building Python 3.6.1 from source under CentOS 7. For CentOS7, I had to first: sudo yum install openssl-dev
Then: ./configure --enable-optimizationsmake altinstall
Now pip3.6 works:-) |
refer:https://stackoverflow.com/questions/41489439/ Pip3-installs-inside-virtual-environment-with-python3-6-failing-due-to-ssl-modul
If you think this article is good or something, you can use the "reward" function on the right to reward me with a cup of coffee "material support", you can also click on the "good text to top" button "spiritual support", because both of these support is to keep me writing, The biggest power to share!
CentOS 6.8 Installation Python3