[英]ImportError: No module named _ssl occurring even when /usr/lib64/python2.7/lib-dynload/_ssl.so is available fc18
I'm seeing urlopen error when I try to do communication on HTTPS 我尝试在HTTPS上进行通讯时看到urlopen错误
<urlopen error unknown url type: https>
I searched for this error and found that this issue is related to ssl. 我搜索了此错误,发现此问题与ssl有关。 I need to have _ssl.so file in my /usr/lib64/python2.7/lib-dynload/ folder. 我需要在/usr/lib64/python2.7/lib-dynload/文件夹中有_ssl.so文件。 But the file is already present. 但是该文件已经存在。 I try to import ssl in python console and see the import error for ssl. 我尝试在python控制台中导入ssl,并看到ssl的导入错误。
Here is the information of file 这是文件的信息
$ ll /usr/lib64/python2.7/lib-dynload/_ssl.so
-r-xr-xr-x. 1 root root 38544 Aug 9 2012 /usr/lib64/python2.7/lib-dynload/_ssl.so
And here is what I'm seeing on python console 这是我在python控制台上看到的
Python 2.7.6 (default, Apr 14 2014, 02:00:55)
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] 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 "ssl.py", line 60, in <module>
import _ssl # if we can't import it, let the error propagate
ImportError: No module named _ssl
Can anybody please help me figure out the issue? 有人可以帮我解决这个问题吗?
I finally figure out the issue. 我终于弄清楚了这个问题。 There were 2 python installations. 有2个python安装。 The installation i was checking for openssl lib, contained the file. 我正在检查openssl lib的安装中包含该文件。 But by default other installation of python was being used for running the programs. 但是默认情况下,其他安装的python用于运行程序。 Once I switched to correct python installation, the error went away. 一旦我切换到正确的python安装,错误就消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.