AttributeError: module 'types' has no attribute 'GenericAlias'
By Gabriel Cooper •
Since I'm working on a linux with no admin rights I tried to install external libs in my project folder like this :
projectRoot
---lib
------some libs
---src
------my project sources
I then updated the PYTHONPATH with {path to the root}/lib:{path to the root}/src
Everything seems to be working and I can import my libs fine but this error happened :
AttributeError: module 'types' has no attribute 'GenericAlias'I know this can be solved by from types import GenericAlias but this error occurs within a lib module, not mine. More specifically when I import urllib.parse.
So what do I do here?
I work on a remote computer and I only have access to a bash but if needed I can provide additionnal informations.
Thanks in advance for your help
1 Answer
Ok, I missed some libs in my project folder and python tried to find them in another python version... That's why.
I put all the required libs in may project and now it works.