在 PyCharm 上导入 NLTK 时出错 [英] Error importing NLTK on PyCharm

查看:39
本文介绍了在 PyCharm 上导入 NLTK 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 PyCharm 中导入 NLTK,并收到以下错误.我在 Mac OS 10.5.8 和 Python 2.7.6 上.会发生什么?我对编程完全陌生,如果我缺少一些基本的东西,很抱歉.

I'm trying to import NLTK in PyCharm, and get the following error. I'm on Mac OS 10.5.8 with Python 2.7.6. What could be going on? I'm completely new to programming, so sorry if there's something basic that I'm missing.

安装包失败:安装包 nltk 时出错.

Install packages failed: Error occurred when installing package 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 中使用它?

ETA: OK, now I've successfully installed NLTK from the command line, and then was able to install it in PyCharm -- but only for the Python 2.5.1 interpreter. If I try it with Python 2.7.6, I still get the error above. Does this matter, or should I not worry about it and just use it with 2.5.1?

推荐答案

你最好坚持使用最新版本的 pip (1.5.6) 并告诉它你不关心它的安全性你的 python 包:

You'd be much better off sticking with the latest version of pip (1.5.6) and just telling it that you don't care about the security of your python packages:

pip install --allow-all-external --allow-unverified ntlk nltk

如果您真的想确保安装运行没有任何投诉,您也可以告诉它不要覆盖任何现有安装:

If you really want to be sure an install runs without complaint, you can also tell it not to overwrite any existing installations:

pip install --upgrade --force-reinstall --allow-all-external --allow-unverified ntlk nltk

pip install --upgrade --force-reinstall --allow-all-external --allow-unverified ntlk nltk

如果您收到文件写入权限错误,请使用 sudo.

And sudo if you get file write permission errors.

这篇关于在 PyCharm 上导入 NLTK 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆