ChatterPy
ChatterPy copied to clipboard
AttributeError: module 'collections' has no attribute 'Hashable'
I'm trying to run code but i got error
AttributeError: module 'collections' has no attribute 'Hashable
How to fix this?
@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.
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.
@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 runpip 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