Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'collections' has no attribute 'Hashable' #3

Open
miruchigawa opened this issue Jun 21, 2023 · 3 comments
Open

Comments

@miruchigawa
Copy link

miruchigawa commented Jun 21, 2023

I'm trying to run code but i got error
AttributeError: module 'collections' has no attribute 'Hashable

How to fix this?

@jdsayle
Copy link

jdsayle commented Aug 26, 2023

@miruchigawa, I was getting the same error even when I installed the 3.12 version of PyYAML which is a dependency listed for chatterbot-corpus. What did resolve this for me was uninstalling my currently installed version of PyYAML using pip and then re-installing the latest version of PyYAML using pip. Let me know if this fixes the issue for you or not though!

Oh, one last thing pip still threw an error (see below) though I was able to run code and interact with a basic chatbot running in the terminal despite getting the dependency error message from pip. That said, I didn't test with the pre-made Django or Flask apps so YMMV with those or your own custom apps.

Code to run to un-install and re-install PyYAML
pip uninstall PyYaml
then run
pip install --upgrade PyYaml

PIP ERROR TEXT
pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. chatterbot-corpus 1.2.0 requires PyYAML<4.0,>=3.12, but you have pyyaml 6.0.1 which is incompatible.

@ShoneGK
Copy link
Owner

ShoneGK commented Aug 26, 2023

Thank you so much for commenting. I was busy with school so i didn't get a chance to look into this. Im looking for a workaround but I suspect that because this is a chatterbot-corpus issue, I will need to create a fork of chatterbot corpus. I can keep this issue open until we find a solution.

@Add9Dev
Copy link

Add9Dev commented Sep 7, 2023

@miruchigawa, I was getting the same error even when I installed the 3.12 version of PyYAML which is a dependency listed for chatterbot-corpus. What did resolve this for me was uninstalling my currently installed version of PyYAML using pip and then re-installing the latest version of PyYAML using pip. Let me know if this fixes the issue for you or not though!

Oh, one last thing pip still threw an error (see below) though I was able to run code and interact with a basic chatbot running in the terminal despite getting the dependency error message from pip. That said, I didn't test with the pre-made Django or Flask apps so YMMV with those or your own custom apps.

Code to run to un-install and re-install PyYAML pip uninstall PyYaml then run pip install --upgrade PyYaml

PIP ERROR TEXT pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. chatterbot-corpus 1.2.0 requires PyYAML<4.0,>=3.12, but you have pyyaml 6.0.1 which is incompatible.

Fixed the issue

outmaneuver added a commit to outmaneuver/ChatterPy that referenced this issue Oct 22, 2024
Related to ShoneGK#3

Update the PyYAML version in `requirements.txt` to the latest version.

* Add `pyyaml>=6.0.1` to the `requirements.txt` file to resolve the AttributeError related to the 'collections' module's 'Hashable' attribute.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/ShoneGK/ChatterPy/issues/3?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants