我试图在 PyCharm 中导入 NLTK,并收到以下错误。我使用的是 Mac OS 10.5.8 和 Python 2.7.6。可能发生什么事?我对编程完全陌生,如果我缺少一些基本的东西,我很抱歉。
安装软件包失败:安装软件包 nltk 时发生错误。
执行了以下命令:
packaging_tool.py install --build-dir /private/var/folders/NG/NGoQZknvH94yHKezwiiT+k+++TI/-Tmp-/pycharm-packaging3166068946358630595.tmp nltk
命令的错误输出:
Downloading/unpacking nltk
Could not fetch URL https://pypi.python.org/simple/nltk/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>
Will skip URL https://pypi.python.org/simple/nltk/ when looking for download links for nltk
Could not fetch URL https://pypi.python.org/simple/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>
Will skip URL https://pypi.python.org/simple/ when looking for download links for nltk
Cannot fetch index base URL https://pypi.python.org/simple/
Could not fetch URL https://pypi.python.org/simple/nltk/: There was a problem confirming the ssl certificate: <urlopen error [Errno 1] _ssl.c:507: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed>
Will skip URL https://pypi.python.org/simple/nltk/ when looking for download links for nltk
Could not find any downloads that satisfy the requirement nltk
Cleaning up...
No distributions at all found for nltk
Storing complete log in /Users/Tom/.pip/pip.log
ETA:好的,现在我已经从命令行成功安装了 NLTK,然后能够在 PyCharm 中安装它——但仅限于 Python 2.5.1 解释器。如果我用 Python 2.7.6 尝试,我仍然收到上面的错误。这有关系吗,还是我不应该担心它,只需将它与 2.5.1 一起使用?
你最好坚持使用最新版本的 pip (1.5.6) 并告诉它你不关心 python 包的安全性:
pip install --allow-all-external --allow-unverified ntlk nltk
如果您确实想确保安装运行时没有任何投诉,您还可以告诉它不要覆盖任何现有安装:
pip install --upgrade --force-reinstall --allow-all-external --allow-unverified ntlk nltk
如果出现文件写入权限错误,请执行 sudo。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)