Words, labels, training, output = pickle.load(f) Inp = results.get_response(ntent)ĪttributeError: 'function' object has no attribute 'get_response'įrom import LancasterStemmer The discord bot comes online but when I try talking to the chat bot using "$prototypebot" on Discord it throws up this error message on my console: Ignoring exception in on_messageįile "C:\Users\amjad\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\discord\client.py", line 343, in _run_eventįile "C:\Users\amjad\OneDrive\Documents\Goldsmiths\Year 3\Final Year\Project\NLTK Chatbot\main.py", line 108, in on_message
On Ubuntu, I was running Python 3.3 and I had to install sudo apt-get install python3.3-dev fPIC -I/usr/include/python2.7 -lpython2.7 utilsmodule.c I managed to solve this issue and generate the. You may add it to your gcc line: gcc $(pkg-config -cflags -libs python2) -Wall utilsmodule.c -o Utilc Instead, use pkg-config, which will output the correct options for your specific system: $ pkg-config -cflags -libs python2 You should not hard code the library and include paths. Make sure that the Python dev files come with your OS. In other words your compile command ought to be: gcc -Wall -I/usr/include/python2.7 -lpython2.7 utilsmodule.c -o Utilc You need to add these flags (replace Python's version accordingly): -I/usr/include/python2.7 -lpython2.7 Second thing is that include files are not by default in the include path, nor is Python library linked with executable by default. Install development package for Python, in case of Debian/Ubuntu/Mint it's done with command: sudo apt-get install python-dev You will probably have to follow up with -L so that gcc can find the library you'll be linking with using -l. You could use the -I flag to specify an additional directory where your compiler should look for headers. Have you installed it system-wide or locally? What's your OS? This means that Python.h isn't in your compiler's default include paths. If your OS is Ubuntu/Debian: sudo apt-get install python-dev Looks like you haven't properly installed the header files and static libraries for python dev.