Autogen tasks fail without pip; pip3 works but pip doesn't

201 Views Asked by At

I'm using Python 3.11 to install and use Autogen. When running, Autogen writes and executes code without human input and (supposedly) can debug errors and rewrite code to complete the task you assign. However, mine keeps getting errors and quits the process because it comes back that pip is not a function.

I've used pip3 or pip3.11 to install packages (since aiohttp won't play nice with Python 3.12), and when I update pip it says that it is already up to date and includes the location that pip is installed, but it does not work as a command. How can I make pip a command? Do I need to install an even older version of python for Autogen to use pip as a command?

2

There are 2 best solutions below

0
On

I'm using python 3.11.4 and autogen works fine with that. Try to use environment(poetry or venv). Or you could try to reinstall python and check the box with "add pip to local PATH". Hope it'll help)

0
On

As per my understanding, the autogen is trying to execute commands with pip but fails because your python3.x version seems to be accessible through pip3 and not pip. You should check the version for both the commands and that should hint at the python versions being used.

pip --version
pip 23.3.1 from /PATH_TO_PYTHON/python3.11/site-packages/pip (python 3.11)
pip3 --version
pip 23.3.1 from /PATH_TO_PYTHON/python3.11/site-packages/pip (python 3.11)

If you notice any discrepancies, then you would need to fix the issue by making pip point to the right python version.

Alternatively for a quick work around, you can try prompting your code executor to use pip3 for all pip related tasks.