【发布时间】:2019-01-07 08:57:16
【问题描述】:
我正在尝试使用 PyDev 在 Eclipse 上导入 numpy,我得到了这个:
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try git clean -xdf (removes all
files not under version control). Otherwise reinstall numpy.
我已经重新安装了 Eclipse 和 Anaconda 的库,一个月前我在另一台笔记本电脑上安装了同样的方式的 Eclipse,我没有收到这个错误,我认为问题是由新版本的 Eclipse 引起的,是有人有同样的问题吗?
我正在使用 Python 3.7
我尝试运行git clean -xdf,但不知道应该在哪里运行。
更新: 我尝试重新安装numpy,我已经卸载成功,但是当我尝试再次安装它时,我收到了这个错误:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting numpy
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/numpy/
Could not find a version that satisfies the requirement numpy (from versions: )
No matching distribution found for numpy
Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
FINISHED
更新:由于下面的一条评论,我的问题得到了解决,可以通过这样做来修补,但是根据 Ananconda,该框不应该被标记,所以我想这一定是解决 numpy 导入错误的另一种方法以更合适的方式。
【问题讨论】:
-
您是否在网络上搜索过
however the ssl module in Python is not available.(加上您使用的操作系统:Windows、Linux或macOS)? -
是的,但没有什么能解决我的问题:(
-
您使用的是什么操作系统以及您尝试解决 SSL 问题的具体方法是什么?
-
我使用的是 Windows 64 位,但我不知道应该如何解决 SSL 问题,当我寻找解决方案时,我没有得到明确的解决方案。我 100% 确定问题与 eclipse 的最新版本有关,而不是 SSL
-
根据错误消息,SSL 问题与 Eclipse 无关。这是一个带有相同错误消息的问题以及有关如何在 Windows 上修复 SSL 问题的答案:stackoverflow.com/q/53137700/6505250