question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'dateutil' has no attribute 'parser'

See original GitHub issue

Hello guys,

I use mongoDB and storage_adapter=“chatterbot.storage.MongoDatabaseAdapter” DB info:

root@chatbot:/home/db# mongo -version
MongoDB shell version v3.6.3

> show dbs
admin                0.000GB
chatterbot-database  0.000GB
`` 

**python script info:**
```Python
`# -*- coding: utf-8 -*-
from chatterbot import ChatBot


# Uncomment the following lines to enable verbose logging
# import logging
# logging.basicConfig(level=logging.INFO)

# Create a new ChatBot instance
bot = ChatBot(
    'Terminal',
    storage_adapter='chatterbot.storage.MongoDatabaseAdapter',
    logic_adapters=[
        'chatterbot.logic.BestMatch'
    ],
    filters=[
        'chatterbot.filters.RepetitiveResponseFilter'
    ],
    input_adapter='chatterbot.input.TerminalAdapter',
    output_adapter='chatterbot.output.TerminalAdapter',
    database='chatterbot-database'
)

print('Type something to begin...')

while True:
    try:
        bot_input = bot.get_response(None)

    # Press ctrl-c or ctrl-d on the keyboard to exit
    except (KeyboardInterrupt, EOFError, SystemExit):
        break`

result info:

root@chatbot:/home/chatbot/py# python3 seven.py
Type something to begin...
haha
hello
nihao
ai.yml Training: [                    ] 1%Traceback (most recent call last):
  File "seven.py", line 28, in <module>
    bot_input = bot.get_response(None)
  File "/usr/local/lib/python3.5/dist-packages/chatterbot/chatterbot.py", line 1                                                                                                                                                             19, in get_response
    self.learn_response(statement, previous_statement)
  File "/usr/local/lib/python3.5/dist-packages/chatterbot/chatterbot.py", line 1                                                                                                                                                             44, in learn_response
    Response(previous_statement.text)
  File "/usr/local/lib/python3.5/dist-packages/chatterbot/conversation.py", line                                                                                                                                                              194, in __init__
    import dateutil.parser as date_parser
  File "/usr/local/lib/python3.5/dist-packages/dateutil/parser.py", line 40, in                                                                                                                                                              <module>
    from six import text_type, binary_type, integer_types
  File "/home/chatbot/py/six.py", line 15, in <module>
    chatbot.train('chatterbot.corpus.english')
  File "/usr/local/lib/python3.5/dist-packages/chatterbot/trainers.py", line 164                                                                                                                                                             , in train
    Response(previous_statement_text)
  File "/usr/local/lib/python3.5/dist-packages/chatterbot/conversation.py", line                                                                                                                                                              194, in __init__
    import dateutil.parser as date_parser
**AttributeError: module 'dateutil' has no attribute 'parser'**

how to solve this error ?

thank you

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gunthercoxcommented, Mar 3, 2018

@bruceforlearn / @vkosuri The dateutill package should come preinstalled as a part of the standard Python installation so no need to install it with pip.

@bruceforlearn I see a few lines in your comments that suggest you have both python 2 and python 3 installed on your system. I suspect that this might be a path issue but I don’t know of a good way to verify this.


I’d suggest trying the following.

  1. Make sure that you are installing and running ChatterBot with Python 3.
  2. Re-installing Python can sometimes correct path issues.
  3. Since this issue appears to be with dateutil and not ChatterBot, you might be able to ask a question about dateutil errors on Stack Overflow to get help from developers who may have encountered this issue before.
0reactions
lock[bot]commented, Mar 9, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: module 'dateutil' has no attribute 'parse'
You can fix this error by modifying your code slightly: from dateutil import parser print(parser.parse("24.05.2017")).
Read more >
Kubernetes dateutil.parser.parse(value) AttributeError: module ...
Kubernetes dateutil. parser. parse(value) AttributeError: module 'dateutil' has no attribute 'parser' - [Deprecated] Rasa X Community Edition - ...
Read more >
AttributeError: module 'dateutil' has no attribute 'parse'
Trying to use dateutil to parse dates from an unknown format but none of the documented methods are found? CODE:
Read more >
[conda] problems with dateutil
import dateutil dateutil.parser. Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: module 'dateutil' has no attribute ...
Read more >
dateutil Documentation
The dateutil module provides powerful extensions to the standard ... Parser issue where calling parse() on dates with no day specified when ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found