I recently upgraded to Python 3.9 and am now having trouble connecting to my Infura endpoint. There seems to be an issue with importing
The error code looks like this:
from web3 import Web3 File "C:\Users\User\Desktop\Misc Python Scripts\ssethereum_final.py", line 2, in <module> from web3 import Web3 File "C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\web3\__init__.py", line 9, in <module> from web3.main import ( File "C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\web3\main.py", line 69, in <module> from web3.manager import ( File "C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\web3\manager.py", line 31, in <module> from web3.middleware import ( File "C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\web3\middleware\__init__.py", line 20, in <module> from .cache import ( # noqa: F401 File "C:\Users\User\AppData\Local\Programs\Python\Python39\Lib\site-packages\web3\middleware\cache.py", line 15, in <module> import lru builtins.ModuleNotFoundError: No module named 'lru'
I updated all of my Python packages (including web3) to latest version, which I thought would install all of the dependencies such as this
lru module, however I’m still getting this error. My code worked with previous versions of Python and I’d rather not have to downgrade to 3.8, it should work no? Any suggestions on how to fix this issue?
Thanks in advance.