gastrodon
gastrodon copied to clipboard
Unable to import
On a clean restart:
import gastrodon
produces
Traceback (most recent call last): File "<input>", line 1, in <module> File "C:\Program Files\JetBrains\PyCharm Community Edition with Anaconda plugin 2020.1\plugins\python-ce\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import module = self._system_import(name, *args, **kwargs) File "C:\Users\andyt\anaconda3\envs\Property\lib\site-packages\gastrodon\__init__.py", line 13, in <module> from typing import Dict,GenericMeta,Match ImportError: cannot import name 'GenericMeta' from 'typing' (C:\Users\andyt\anaconda3\envs\Property\lib\typing.py)
running the same in Jupyter gives a little more info:
`ImportError Traceback (most recent call last)
~\anaconda3\lib\site-packages\gastrodon_init_.py in
ImportError: cannot import name 'GenericMeta' from 'typing' (C:\Users\andyt\anaconda3\lib\typing.py)`
I had the same issue! Some googling lead me to this comment here https://github.com/hsolbrig/PyShEx/issues/17#issuecomment-427557545.
Changing
from typing import Dict,GenericMeta,Match
to
from typing import Dict,Match
try:
from typing import GenericMeta
except ImportError:
class GenericMeta(type): pass
in gastrodons _init_.py did indeed solved the problem for me (as far as I can tell after using the package for only an hour).
Edit: Just noticed that there is already a Pull Request regarding the issue: #5