Enter Pipt hint: attributeerror: ' Module ' object has no attribute ' httpsconnection '

Source: Internet
Author: User

Article turned from: http://write.blog.csdn.net/postedit/51725016

1. Testing

[[email protected] ~]# python

Python 2.7.8 (default, June 17 2016, 01:25:39)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import SSL
Traceback (most recent):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/ssl.py", line A, in <module>
Import _ssl # If we can ' t import it, let the error propagate

Importerror:no module named _ssl

2. View

[email protected] ~]# Yum List installed | grep SSL
openssl.x86_64 1.0.0-27.el6 @anaconda-centos-201303020151.x86_64/6.4

3. Installation

[email protected] ~]# Yum install openssl-devel-y

4. View Results

[Email protected] ~]# Rpm-aq|grep OpenSSL
Openssl-1.0.1e-48.el6_8.1.x86_64
Openssl-devel-1.0.1e-48.el6_8.1.x86_64

5. Recompile python

#修改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

6. Recompile

Make
Make install

7. Test results

[[email protected] ~]# python
Python 2.7.8 (default, June 21 2016, 17:51:18)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
>>> Import _ssl
>>> exit ()

(GO) input pipt hint: attributeerror: ' Module ' object has no attribute ' httpsconnection '

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.