4

I'm trying to use the library Chatterbot, but I got this error RuntimeError: implement_array_function method already has a docstring I don't understand! Can you help me?

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer

# Create a new chat bot named Charlie
chatbot = ChatBot('Charlie')

trainer = ListTrainer(chatbot)

trainer.train([
    "Hi, can I help you?",
    "Sure, I'd like to book a flight to Iceland.",
    "Your flight has been booked."
])

# Get a response to the input text 'I would like to book a flight.'
response = chatbot.get_response('I would like to book a flight.')

print(response)
> "C:\Users\Juan Montañez\PycharmProjects\1\Scripts\python.exe"
> "C:/Users/Juan Montañez/ChatBot/Perseus/index.py" Traceback (most
> recent call last):   File "C:/Users/Juan
> Montañez/ChatBot/Perseus/index.py", line 1, in <module>
>     from chatterbot import ChatBot   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\chatterbot\__init__.py",
> line 4, in <module>
>     from .chatterbot import ChatBot   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\chatterbot\chatterbot.py",
> line 2, in <module>
>     from chatterbot.storage import StorageAdapter   File "C:\Users\Juan
> Montañez\PycharmProjects\1\lib\site-packages\chatterbot\storage\__init__.py",
> line 1, in <module>
>     from chatterbot.storage.storage_adapter import StorageAdapter   File "C:\Users\Juan
> Montañez\PycharmProjects\1\lib\site-packages\chatterbot\storage\storage_adapter.py",
> line 3, in <module>
>     from chatterbot.tagging import PosHypernymTagger   File "C:\Users\Juan
> Montañez\PycharmProjects\1\lib\site-packages\chatterbot\tagging.py",
> line 3, in <module>
>     from chatterbot import utils   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\chatterbot\utils.py",
> line 4, in <module>
>     from nltk.corpus import wordnet   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\nltk\__init__.py", line
> 129, in <module>
>     from nltk.collocations import *   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\nltk\collocations.py",
> line 40, in <module>
>     from nltk.metrics import ContingencyMeasures, BigramAssocMeasures, TrigramAssocMeasures, QuadgramAssocMeasures   File "C:\Users\Juan
> Montañez\PycharmProjects\1\lib\site-packages\nltk\metrics\__init__.py",
> line 16, in <module>
>     from nltk.metrics.scores import (   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\nltk\metrics\scores.py",
> line 18, in <module>
>     from scipy.stats.stats import betai   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\scipy\__init__.py", line
> 62, in <module>
>     from numpy import show_config as show_numpy_config   File "C:\Users\Juan
> Montañez\PycharmProjects\1\lib\site-packages\numpy\__init__.py", line
> 142, in <module>
>     from . import add_newdocs   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\add_newdocs.py",
> line 13, in <module>
>     from numpy.lib import add_newdoc   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\lib\__init__.py",
> line 9, in <module>
>     from .index_tricks import *   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\lib\index_tricks.py",
> line 13, in <module>
>     import numpy.matrixlib as matrixlib   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\matrixlib\__init__.py",
> line 6, in <module>
>     from .defmatrix import *   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\matrixlib\defmatrix.py",
> line 12, in <module>
>     from numpy.linalg import matrix_power   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\linalg\__init__.py",
> line 51, in <module>
>     from .linalg import *   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\linalg\linalg.py",
> line 32, in <module>
>     from numpy.core.overrides import set_module   File "C:\Users\Juan Montañez\PycharmProjects\1\lib\site-packages\numpy\core\overrides.py",
> line 46, in <module>
>     """) RuntimeError: implement_array_function method already has a docstring
jkr
  • 17,119
  • 2
  • 42
  • 68
  • I have a comparable problem but with totally different libraries, using blender and self-implemented chatbot-functions. I start suspecting this must be somehow related to doubled imports... – CLpragmatics Oct 25 '19 at 12:09
  • I experienced the same type error, solved by reinstalling venv. – ZDL-so Sep 16 '20 at 12:51

1 Answers1

3

See numpy issue.

Try downgrading numpy to version 1.15.4.

You may get another error like typing-extensions module not found.

Simply pip install the missing module.

Taiwotman
  • 885
  • 14
  • 27