Open oldgithubman opened 4 months ago
The LLM generated code and didn't specify to install the numpy dep prior to running it, so when executed the code resulted in the error you see. This is a common occurrence when LLMs write code. You can try updating the system prompt to nudge it towards specifying dependencies. If you let the conversation continue usually the LLM will also catch this mistake and then respond saying to install numpy and will fix its mistake.
In the tutorial, the code block using numpy is using the local executor (the tutorial instructs you to install numpy before), because of what you saw.
If you'd like to follow this example in docker you could execute a code block which installs numpy:
code_block = """
```sh
pip install numpy
"""
Maybe the documentation can be improved? This was not obvious to me
Describe the bug
ModuleNotFoundError: No module named 'numpy'
Steps to reproduce
Follow tutorial
Model Used
False
Expected Behavior
Work
Screenshots and logs
This is the end of the message. """
Generate a reply for the given code.
reply = code_executor_agent_using_docker.generate_reply(messages=[{"role": "user", "content": message_with_code_block}]) print(reply) $ python test.py Provide feedback to the sender. Press enter to skip and use auto-reply, or type 'exit' to end the conversation:
Additional Information
AutoGen Version: 0.2.21 Operating System: Linux Mint 21.3 Cinnamon Python Version: 3.10.14