nuno-andre / python-wikijs

WikiJs Python API client
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Cannot import "Any" from typing #1

Open penfold1972 opened 1 year ago

penfold1972 commented 1 year ago

I get this error with a test running python 3.9.13 in a virtual environment on Rocky Linux 8:

  File "/home/scobb/wikijs/lab_search.py", line 2, in <module>
    from wikijs import WikiJs
  File "/home/scobb/wikijs/env/lib64/python3.9/site-packages/wikijs/__init__.py", line 1, in <module>
    from .client import WikiJs
  File "/home/scobb/wikijs/env/lib64/python3.9/site-packages/wikijs/client.py", line 12, in <module>
    from .asset import AssetMixin
  File "/home/scobb/wikijs/env/lib64/python3.9/site-packages/wikijs/asset.py", line 1, in <module>
    from .typing import WikiJsProtocol, TYPE_CHECKING, Any
ImportError: cannot import name 'Any' from 'wikijs.typing' (/home/scobb/wikijs/env/lib64/python3.9/site-packages/wikijs/typing.py)

The script is basically the given example:


from lab_api import WIKIJS_API
from wikijs import WikiJs

HOST = "wiki.example.org"
URL = f"https://{HOST}/"

client = WikiJs(URL, WIKIJS_API)

TARGET_FOLDER = "/"
for page in client.search_pages('', TARGET_FOLDER):
    print(page['path'])```
Not sure where to go from here.
penfold1972 commented 1 year ago

It looks to me that the typing.py file imports "Any" from the typing module, but the execution thinks it should be getting it from itself?