importing tronweb shows import error: cannot import name 'hashable' from 'collections'

2.6k Views Asked by At

After installing tronweb using 'pip install tronweb', when I try to import but it shows an import error which is cannot import name 'hashable' from 'collections'

2

There are 2 best solutions below

2
On

In my recommendation it is better to use tronweb in a local service as an API using the latest tronweb library but in JS

0
On

Search by error message for the import instruction and you should edit:

from collections import Hashable

to:

from collections.abc import Hashable

It was moved from collections to collections.abc since Python 3.3. It supported the old location till Python 3.9. But in python 3.10 it was removed.