monarch-initiative / ontogpt

LLM-based ontological extraction tools, including SPIRES
https://monarch-initiative.github.io/ontogpt/
BSD 3-Clause "New" or "Revised" License
603 stars 75 forks source link

Cannot Set API Key. ModuleNotFoundError Occured. #336

Closed zhengzaiyi closed 8 months ago

zhengzaiyi commented 8 months ago

I created a conda environment with a Python version of 3.9, then install the ontogpt:

conda create -n ontogpt python=3.9
conda activate ontogpt 
pip install ontogpt

It works fine. However, when I try to set the API key, a ModuleNotFoundError occurred:

runoak set-apikey -e openai <your openai api key>
# Error
Traceback (most recent call last):
  File "/home/user/.conda/envs/ontogpt/bin/runoak", line 5, in <module>
    from oaklib.cli import main
  File "/home/user/.conda/envs/ontogpt/lib/python3.9/site-packages/oaklib/__init__.py", line 9, in <module>
    from oaklib.selector import get_adapter, get_implementation_from_shorthand  # noqa:F401
  File "/home/user/.conda/envs/ontogpt/lib/python3.9/site-packages/oaklib/selector.py", line 15, in <module>
    from oaklib.implementations import GildaImplementation
  File "/home/user/.conda/envs/ontogpt/lib/python3.9/site-packages/oaklib/implementations/__init__.py", line 13, in <module>
    from oaklib.implementations.cx.cx_implementation import CXImplementation
  File "/home/user/.conda/envs/ontogpt/lib/python3.9/site-packages/oaklib/implementations/cx/cx_implementation.py", line 9, in <module>
    from oaklib.implementations.obograph.obograph_implementation import (
  File "/home/user/.conda/envs/ontogpt/lib/python3.9/site-packages/oaklib/implementations/obograph/obograph_implementation.py", line 9, in <module>
    from kgcl_schema.datamodel import kgcl
ModuleNotFoundError: No module named 'kgcl_schema'

Has anyone encountered this issue and successfully resolved it?

hrshdhgd commented 8 months ago

Thanks of reporting this @zhengzaiyi , a fix is on its way. Sorry about that! As a quick solution, you could try

pip install kgcl-schema==0.6.4
hrshdhgd commented 8 months ago

Issue has been resolved. If you uninstall and reinstall ontogpt, everything should work as expected. Feel free to close issue to confirm this.

caufieldjh commented 8 months ago

Thanks @hrshdhgd - ran into this issue this morning too and couldn't replicate it.

zhengzaiyi commented 8 months ago

Issue has been resolved. If you uninstall and reinstall ontogpt, everything should work as expected. Feel free to close issue to confirm this.

Thank you @hrshdhgd, that was quick!