【问题标题】:(ChatterBot) Could not install packages due to an EnvironmentError: [Errno 13] Permission denied:(ChatterBot) 由于 EnvironmentError 无法安装软件包:[Errno 13] 权限被拒绝:
【发布时间】:2020-05-12 22:17:23
【问题描述】:

我正在尝试在 PyCharm 中使用 ChatterBot,但是在运行一个简单的示例程序时:

from chatterbot import ChatBot

chatbot= ChatBot("Josie")

from chatterbot.trainers import ListTrainer

conversation = ["Hello","Hi There",
               "How are you doing?", "I'm doing great.",
               "That is good to hear", "Thank you.", "You're welcome."]

trainer = ListTrainer(chatbot)

trainer.train(conversation)

response = chatbot.get_response("Good morning!")
print (response)

我收到了这个运行时错误:

/Users/williams/PycharmProjects/test_1/venv/bin/python /Users/williams/PycharmProjects/test_1/test_1.py
[nltk_data] Error loading stopwords: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed:
[nltk_data]     unable to get local issuer certificate (_ssl.c:1076)>
[nltk_data] Error loading wordnet: <urlopen error [SSL:
[nltk_data]     CERTIFICATE_VERIFY_FAILED] certificate verify failed:
[nltk_data]     unable to get local issuer certificate (_ssl.c:1076)>
[nltk_data] Error loading averaged_perceptron_tagger: <urlopen error
[nltk_data]     [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify
[nltk_data]     failed: unable to get local issuer certificate
[nltk_data]     (_ssl.c:1076)>
Traceback (most recent call last):
 File "/Users/williams/PycharmProjects/test_1/venv/lib/python3.7/site-packages/nltk/corpus/util.py", line 83, in __load
List Trainer: [######              ] 29%    root = nltk.data.find("{}/{}".format(self.subdir, zip_name))
 File "/Users/williams/PycharmProjects/test_1/venv/lib/python3.7/site-packages/nltk/data.py", line 585, in find
   raise LookupError(resource_not_found)
LookupError: 
**********************************************************************
 Resource stopwords not found.
 Please use the NLTK Downloader to obtain the resource:

 >>> import nltk
 >>> nltk.download('stopwords')

 For more information see: https://www.nltk.org/data.html

 Attempted to load corpora/stopwords.zip/stopwords/

我运行了以下代码:

import nltk
nltk.download('stopwords')

但仍然收到错误消息“SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1076)>”

我尝试过使用/Applications/Python\ 3.7/Install\ Certificates.command,但我再次收到错误:

我快疯了,想弄清楚这一点。任何帮助将不胜感激。

【问题讨论】:

  • 安装东西时应该使用sudo

标签: python pycharm chatterbot certifi


【解决方案1】:

用用户选项试试:

pip install --upgrade --user certifi

【讨论】:

    猜你喜欢
    • 2019-03-27
    • 2019-06-07
    • 2019-01-25
    • 2019-01-08
    • 2021-12-26
    • 2021-11-22
    • 1970-01-01
    • 2020-06-09
    • 1970-01-01
    相关资源
    最近更新 更多