Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to import #8

Open
andydoc opened this issue Apr 23, 2020 · 1 comment
Open

Unable to import #8

andydoc opened this issue Apr 23, 2020 · 1 comment

Comments

@andydoc
Copy link

andydoc commented Apr 23, 2020

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)
in
----> 1 import gastrodon

~\anaconda3\lib\site-packages\gastrodon_init_.py in
11 from types import FunctionType,LambdaType,GeneratorType,CoroutineType,FrameType,CodeType,MethodType
12 from types import BuiltinFunctionType,BuiltinMethodType,DynamicClassAttribute,ModuleType,AsyncGeneratorType
---> 13 from typing import Dict,GenericMeta,Match
14 from urllib.error import HTTPError
15 from urllib.parse import urlparse

ImportError: cannot import name 'GenericMeta' from 'typing' (C:\Users\andyt\anaconda3\lib\typing.py)`

@om-hb
Copy link

om-hb commented Jul 4, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants