使用Python 3.7在Anaconda中安装chatterbot
时,出现以下错误:
找到现有的安装:PyYAML 3.13无法卸载“ PyYAML”。它 是distutils安装的项目,因此我们无法准确 确定哪些文件属于它,这只会导致部分文件 卸载。
答案 0 :(得分:0)
chatterbot
环境中安装conda
conda
环境conda create --name chatterbot_example python=3.7
source activate chatterbot_example
chatterbot
和chatterbot-corpus
:pip install chatterbot
pip install chatterbot-corpus
example.py
)中显示的基本信息:from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Ron Obvious')
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)
# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.english")
# Get a response to an input statement
print(chatbot.get_response("Hello, how are you today?"))
python example.py
输出:
python example.py
[nltk_data] Downloading package stopwords to /home/cefalo/nltk_data...
[nltk_data] Package stopwords is already up-to-date!
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] /home/cefalo/nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
Training ai.yml: [####################] 100%
Training botprofile.yml: [####################] 100%
Training computers.yml: [####################] 100%
Training conversations.yml: [####################] 100%
Training emotion.yml: [####################] 100%
Training food.yml: [####################] 100%
Training gossip.yml: [####################] 100%
Training greetings.yml: [####################] 100%
Training health.yml: [####################] 100%
Training history.yml: [####################] 100%
Training humor.yml: [####################] 100%
Training literature.yml: [####################] 100%
Training money.yml: [####################] 100%
Training movies.yml: [####################] 100%
Training politics.yml: [####################] 100%
Training psychology.yml: [####################] 100%
Training science.yml: [####################] 100%
Training sports.yml: [####################] 100%
Training trivia.yml: [####################] 100%
Tell me a joke
系统信息:
Conda版本信息:
conda --version
conda 4.5.11
已安装的软件包:
attrs==19.1.0
blis==0.2.4
certifi==2019.3.9
chardet==3.0.4
ChatterBot==1.0.5
chatterbot-corpus==1.2.0
cymem==2.0.2
idna==2.8
jsonschema==3.0.1
mathparse==0.1.2
murmurhash==1.0.2
nltk==3.4.1
numpy==1.16.3
Pint==0.9
plac==0.9.6
preshed==2.0.1
pymongo==3.8.0
pyrsistent==0.15.2
python-dateutil==2.7.5
pytz==2019.1
PyYAML==3.13
requests==2.22.0
six==1.12.0
spacy==2.1.4
SQLAlchemy==1.2.19
srsly==0.0.5
thinc==7.0.4
tqdm==4.32.1
urllib3==1.25.2
wasabi==0.2.2
答案 1 :(得分:0)
更新@arsho共享的解决方案。
对于4.6之前的conda版本,请使用:
ExcelApp = win32com.client.Dispatch("Excel.Application")
ExcelApp.visible = True
wb = ExcelApp.Workbooks.Open(old_file_path)
wb = ExcelApp.ActiveWorkbook
ExcelApp.Sheets("KW16").Select()
activesheet = ExcelApp.activesheet
col_end = activesheet.UsedRange.columns.count
row_end = activesheet.UsedRange.rows.count
ExcelApp.document.body.InnerHTML = activesheet.Range(activesheet.Cells(1,1),
activesheet.Cells(row_end,col_end))
activate snakes
对于conda 4.6和更高版本,请使用:
source activate snakes