agiresearch / AIOS

AIOS: LLM Agent Operating System
https://aios.foundation
MIT License
3.4k stars 405 forks source link

[Bug] ModuleNotFoundError: No module named 'openagi' #136

Closed wawa0210 closed 4 months ago

wawa0210 commented 5 months ago

When I installed the demo according to https://github.com/agiresearch/AIOS readme, when I ran the real demo -> python main.py --llm_name ollama/qwen:7b, an error message appeared: ModuleNotFoundError: No module named 'openagi',

(AIOSS) ➜  AIOS git:(main) python main.py --llm_name ollama/qwen:7b
Traceback (most recent call last):
  File "/Users/zhangxiao/go/src/github.com/wawa0210/aii/AIOS/main.py", line 13, in <module>
    from openagi.src.agents.agent_factory import AgentFactory
ModuleNotFoundError: No module named 'openagi'

But I was able to find the corresponding module through pip show openagi, which was very confusing

(AIOSS) ➜  AIOS git:(main) python main.py --llm_name ollama/qwen:7b
Traceback (most recent call last):
  File "/Users/zhangxiao/go/src/github.com/wawa0210/aii/AIOS/main.py", line 13, in <module>
    from openagi.src.agents.agent_factory import AgentFactory
ModuleNotFoundError: No module named 'openagi'
(AIOSS) ➜  AIOS git:(main) pip show openagi
Name: openagi
Version: 0.0.1
Summary: OpenAGI: Package for AI Agent Creation
Home-page:
Author:
Author-email:
License: MIT License

Copyright (c) 2024 AGI Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Location: /Users/zhangxiao/miniconda/envs/AIOSS/lib/python3.11/site-packages
Editable project location: /Users/zhangxiao/go/src/github.com/wawa0210/aii/OpenAGI
Requires: chromadb, click, google-api-python-client, googlemaps, langchain-community, langchain-core, llama-index-core, llama-index-embeddings-huggingface, llama-index-readers-file, llama-index-vector-stores-chroma, numpy, ollama, openai, pandas, pre-commit, protobuf, pydantic, pympler, pytest, python-dotenv, requests, torch, transformers, wikipedia, wolframalpha
Required-by:
dongyuanjushi commented 5 months ago

Could you provide more details of how you install the openagi?

wawa0210 commented 5 months ago

Could you provide more details of how you install the openagi?

I installed it according to this readme --> https://github.com/agiresearch/AIOS

cd ../OpenAGI
pip install -e .
image
dongyuanjushi commented 5 months ago

I find this issue is due to the pyproject.toml file that we used has some conflicts with the setup.py in the OpenAGI package. I am gonna fix this.

dongyuanjushi commented 5 months ago

The installation from pip install from pypi (pip install pyopenagi) and locally (cd OpenAGI and pip install -e .) should be fixed now.

wawa0210 commented 5 months ago

The installation from pip install from pypi (pip install pyopenagi) and locally (cd OpenAGI and pip install -e .) should be fixed now.

I installed pyopenagi==0.0.3 via pip, but the code still reports Import "pyopenagi.src.agents.agent_factory" could not be resolved and nothing found in virtualenv

The file size on pypi is probably incorrect --> https://pypi.org/project/pyopenagi/#files, currently only 3.5KB image

dongyuanjushi commented 5 months ago

I see, the pip install -e . should be fixed now. Maybe it is something wrong during packgin with pyproject.toml, so the PyPI version is incorrect. I will check the problem and fix that.

dongyuanjushi commented 5 months ago

The PyPI version is updated. Please have a check of whether it can work now.