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

ModuleNotFoundError: No module named 'autogen' #292

Closed
gsorlin opened this issue Oct 19, 2023 · 11 comments
Closed

ModuleNotFoundError: No module named 'autogen' #292

gsorlin opened this issue Oct 19, 2023 · 11 comments

Comments

@gsorlin
Copy link

gsorlin commented Oct 19, 2023

I'm getting this error when trying to import autogen into my project. Initial steps I followed during setup in the terminal in VS Code:

1/ Conda create -n autogen python=3.11.4
2/ Conda activate autogen
3/ pip install pyautogen
4/ python --version (confirmed I'm on correct version)

Troubleshooting steps I've tried so far without success:

1/ Confirmed everything is running python 3.11.4
2/ Uninstalled and reinstalled pyautogen (also confirmed I didn't accidentally install autogen)
3/ Tried uninstalling, then starting the install fresh in venv.

Any other ideas about how to get past this point?

@thinkall
Copy link
Collaborator

thinkall commented Oct 19, 2023

@gsorlin Try conda deactivate a few times to make sure you're not in any env, not even base. Then conda activate autogen.

I have no idea if this would work for you, just a guess.

@priyansh4320
Copy link
Contributor

here are some solution what you could try:

  1. ctrl + shift + p , type select interpretor , refresh the list.
  2. if you are using 'git bash' as terminal then activate env as 'source path/to/anaconda autogen'
  3. another reason might be that your IDE might be looking for pakages into your local python lib path and not in conda, in order th get rid of this here are some steps:
    (1) remove local python path from env variable
    (2) try refreshing the interpretor list , and then activate autogen env
    (3) if this is not working then try uninstall conda and then uninstall vscode 1st and then reinstall conda 1st and then reinstall vscode , now set up env and activate
    these solutions might helpyou solve module not found error

@gsorlin
Copy link
Author

gsorlin commented Oct 22, 2023

Thank you all for you tips and help! I ended up just installing Code Interpreter and having GPT4 fix it for me 😅.

Now working as expected!

@gsorlin gsorlin closed this as completed Oct 22, 2023
@KDragHowdy
Copy link

Did anyone get a fix?? Same issue with not finding module even though ive got it installed in the conda env and have that load in interpretor and pyautogen shows up when i conda list the env from the terminal!

@TechKemon
Copy link

same issue here

@teachable-david
Copy link

Thank you all for you tips and help! I ended up just installing Code Interpreter and having GPT4 fix it for me 😅.

Now working as expected!

@gsorlin hey check out how many people you could help if you shared the solution that Code Interpreter found for you

@oldgithubman
Copy link

oldgithubman commented Apr 4, 2024

same issue here
If you do

import sys
sys.path

in python and check all the paths, you might find autogen is not there. Something to look into, devs? For me, autogen is in:

- /usr/local/lib/python3.10/dist-packages
- /home/[user]/pyautogen/lib/python3.10/site-packages
- /usr/local/lib/python3.10/dist-packages/flaml
- /home/[user]/pyautogen/lib/python3.10/site-packages/flaml

whereas sys.path outputs

- /home/j/miniforge3/envs/pyautogen/lib/python310.zip
- /home/j/miniforge3/envs/pyautogen/lib/python3.10
- /home/j/miniforge3/envs/pyautogen/lib/python3.10/lib-dynload
- /home/j/.local/lib/python3.10/site-packages
- /home/j/miniforge3/envs/pyautogen/lib/python3.10/site-packages

Solution: copy everything from /home/[user]/pyautogen/lib/python3.10/site-packages to /home/j/miniforge3/envs/pyautogen/lib/python3.10

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 4, 2024

@oldgithubman
Copy link

https://microsoft.github.io/autogen/docs/FAQ#install-the-correct-package---pyautogen

This is not the problem. See my comment above for the real solution

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 4, 2024

https://microsoft.github.io/autogen/docs/FAQ#install-the-correct-package---pyautogen

This is not the problem. See my comment above for the real solution

Right. Thanks for point this out.

@diouck
Copy link

diouck commented Aug 27, 2024

Hello, I just tested the config and I encountered the same error

chainlit run appUI.py 2024-08-27 22:55:09 - Loaded .env file Traceback (most recent call last): File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\Scripts\chainlit.exe\__main__.py", line 7, in <module> File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1157, in __call__ return self.main(*args, **kwargs) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\chainlit\cli\__init__.py", line 154, in chainlit_run run_chainlit(target) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\chainlit\cli\__init__.py", line 47, in run_chainlit load_module(config.run.module_name) File "C:\Users\Abdou\AppData\Local\Programs\Python\Python310\lib\site-packages\chainlit\config.py", line 242, in load_module spec.loader.exec_module(module) File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "C:\Users\Abdou\Documents\PythonProjects\LLAMA\autogen_graphRAG\appUI.py", line 4, in <module> import autogen ModuleNotFoundError: No module named 'autogen'

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

10 participants