microsoft / autogen

A programming framework for agentic AI 🤖
https://microsoft.github.io/autogen/
Creative Commons Attribution 4.0 International
32.71k stars 4.76k forks source link

autogen-magentic-one ModuleNotFoundError: No module named 'autogen_core' #4079

Open fahdmirza opened 4 hours ago

fahdmirza commented 4 hours ago

Hi, I am trying to run example for autogen-magentic-one and followed all the steps in your docs but getting following error:

python autogen-magentic-one/examples/example_coder.py --logs_dir ./my_logs Traceback (most recent call last): File "/home/Ubuntu/autogen/python/packages/autogen-magentic-one/examples/example_coder.py", line 10, in from autogen_core.application import SingleThreadedAgentRuntime ModuleNotFoundError: No module named 'autogen_core'

The docs mentioned to run example.py but there is no example.py in the repo.

I am running this in conda environment. Thanks. regards

victordibia commented 4 hours ago

Hi @fahdmirza,

Following the instructions here, ensure you have run the pip install from github main (not pypi).

git clone  https://github.com/microsoft/autogen.git
cd autogen/python/packages/autogen-magentic-one
pip install -e .

This should install autogen_core and autogen_ext which are needed for magentic one.

Please let us know if you have any other issues.

. Edit... Another option is to use the install guide for the autogen_core package here.

First install uv.

git clone  https://github.com/microsoft/autogen.git
cd autogen/python
uv sync  --all-extras
source .venv/bin/activate

uv sync installs all packages in a venv environment that you activate and use.

@afourney @husseinmozannar

matbee-eth commented 4 hours ago

Hi @fahdmirza,

Following the instructions here, ensure you have run the pip install from github main (not pypi).

git clone https://github.com/microsoft/autogen.git cd autogen/python/packages/autogen-magentic-one pip install -e . This should install autogen_core and autogen_ext which are needed for magentic one.

Please let us know if you have any other issues.

@afourney @husseinmozannar

Does not work, it is still not found, we probably have to manually add ../../ to sys.paths.

I did make it work, however, by using the venv created by:

./autogen/python: uv sync  --all-extras
./autogen/python: source .venv/bin/activate
fahdmirza commented 4 hours ago

Thanks for update. Unfortunately, still same error. Also where is example.py mentioned in Readme? I am trying to review it for my channel https://www.youtube.com/@fahdmirza and that is why trying to use a representative example. Thanks.

Fahd

husseinmozannar commented 4 hours ago

We are working on making installation much easier, please bear with us as we finish that.

For now:

The example script is here https://github.com/microsoft/autogen/blob/main/python/packages/autogen-magentic-one/examples/example.py

Make sure you are on the main branch and not staging (previous readme had an error)

The easiest way to install is with uv:

git clone  https://github.com/microsoft/autogen.git
cd autogen/python
uv sync  --all-extras
source .venv/bin/activate
cd packages/autogen-magentic-one
pip install -e .

then follow the complete README in https://github.com/microsoft/autogen/blob/main/python/packages/autogen-magentic-one/README.md

ekzhu commented 3 hours ago

@fahdmirza you quite early on this. We are working on the API so be aware of breaking changes coming until this stabilize toward end of Nov.

fahdmirza commented 3 hours ago

I understand, I just want to have a working demo of it to get a taste for my viewers and intend to cover it again when it matures. Already a big fan of Autogen and have been covering it since last 9 months or so in various videos. I will give it a try again shortly as per above guidelines, thanks.