简体   繁体   English

ImportError:即使/usr/lib64/python2.7/lib-dynload/_ssl.so可用,也不会发生名为_ssl的模块

[英]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.

相关问题 Python:ImportError:/usr/local/lib/python2.7/lib-dynload/_io.so:undefined symbol:PyUnicodeUCS2_Replace - Python: ImportError: /usr/local/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS2_Replace Python lib / python2.7 / lib-dynload / _io.so:未定义的符号:_PyErr_ReplaceException - Python lib/python2.7/lib-dynload/_io.so: undefined symbol: _PyErr_ReplaceException python + 脚本在 /usr/lib64/python2.7 下的密码学失败 - python + script failed regarding to cryptography under /usr/lib64/python2.7 ImportError:dlopen(/usr/local/lib/python2.7/site-packages/_geoslib.so - ImportError: dlopen(/usr/local/lib/python2.7/site-packages/_geoslib.so python 安装中缺少 lib-dynload - lib-dynload missing in python install 文件“ /usr/lib/python2.7/importlib/__init__.py”,第37行,位于import_module __import __(name)ImportError中:没有名为django的模块 - File “/usr/lib/python2.7/importlib/__init__.py”, line 37, in import_module __import__(name) ImportError: No module named django Python 2.7 ImportError:没有名为_ssl的模块 - Python 2.7 ImportError: no module named _ssl Anaconda ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found - Anaconda ImportError: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found DLIB:导入错误:/usr/local/cuda/lib64/libcudnn.so.7:文件太短 - DLIB: ImportError: /usr/local/cuda/lib64/libcudnn.so.7: file too short 导入错误:没有名为 MySQLdb Python2.7 的模块 - ImportError: No module named MySQLdb Python2.7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM