CentOS 6.8 Installation Python3

Source: Internet
Author: User
Tags install openssl

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.