简体   繁体   中英

Error using Chatterbot while using a 64-bit system

I' am currently trying to develop a Chatbot using pythons open-source 'chatterbot' library and I have run into an error whilst trying to execute a program.

I'm using Python 3.7. on the anaconda terminal i receive the error:

OSError: [WinError 193] %1 is not a valid Win32 application

after executing the code below though the anaconda terminal, is there something obvious that I' am missing or are there any suggestions for how i could proceed?

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import os

bot = ChatBot('Bot')
bot.set_trainer(ListTrainer)

for files in os.listdir('C:/Users/ben\ChatterBot-master\chatterbot- 
corpus-master\chatterbot_corpus\data\english/'):
        data = open('C:/Users/ben\ChatterBot-master\chatterbot-corpus- 

master\\chatterbot_corpus\\data\\english/' + files ,'r').readlines() bot.train(data)

while True:
        message = input ('You:')
        if message.strip() != 'Bye':
                reply = bot.get_response(message)
                print('ChatBot :',reply)
        if message.strip() == 'Bye':
                print('Chatbot : Bye')
                break

I expected the terminal to begin the chatbot conversation but i cannot get past this error, i have tried removing and reinstalling python to no avail.

Windows is complaining that what you're trying to run is not an executable. I suspect that you're trying to run something.py in your terminal. Run python something.py instead to have the Python interpreter run your file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM