Closed sulaimonao closed 1 year ago
AutoGPT runs Python scripts within a container. To use AutoGPT, you have two options: either install Docker (which allows AutoGPT to initiate a temporary container for script execution) or directly run AutoGPT inside a container. I prefer starting run.sh in an existing container that already has Python and common packages installed. This also helps to save the execution time.
AutoGPT runs Python scripts within a container. To use AutoGPT, you have two options: either install Docker (which allows AutoGPT to initiate a temporary container for script execution) or directly run AutoGPT inside a container. I prefer starting run.sh in an existing container that already has Python and common packages installed. This also helps to save the execution time.
I have docker Installed not sure what the issue is
I am touching the exact same part of the code, I am not sure we are talking about the same issue but myself I got the logs
Image 'python:3-alpine' found locally
SYSTEM: Command execute_python_code returned: Traceback (most recent call last): File "/workspace/FSGPT/executed_code/fibonacci.py", line 1, in <module> import openpyxl ModuleNotFoundError: No module named 'openpyxl'
First line Auto-GPT runs in a container python:3-alpine
no worries about that.
But then in the python code there is a line import openpyxl
but this module needs to be installed and is not in python:3-alpine
default docker image...
I have been trying to make a conversation on Discord https://discord.com/channels/1092243196446249134/1092266131110236170/1123560112989163540
Auto-GPT isn't able to install python modules in the docker container they need to be used. Whatever how you run Auto-GPT with docker or with python straight.
For me there are 2 alternatives:
Dockerfile
ready to go and the requirements.txt
, regex
.I have been trying to make a regex
to find all the import in a file
https://github.com/Significant-Gravitas/Auto-GPT/pull/4847/files#diff-3a17cf79b7ab8e6b1ea66d34144971f6bb366c5638a666af493889d91f4cac5aR103
regex_imports = re.findall(r"import (.*(?=\n))", code)
It's kind of working...
I am touching the exact same part of the code, I am not sure we are talking about the same issue but myself I got the logs
Image 'python:3-alpine' found locally SYSTEM: Command execute_python_code returned: Traceback (most recent call last): File "/workspace/FSGPT/executed_code/fibonacci.py", line 1, in <module> import openpyxl ModuleNotFoundError: No module named 'openpyxl'
First line Auto-GPT runs in a container
python:3-alpine
no worries about that. But then in the python code there is a lineimport openpyxl
but this module needs to be installed and is not inpython:3-alpine
default docker image...I have been trying to make a conversation on Discord https://discord.com/channels/1092243196446249134/1092266131110236170/1123560112989163540
Auto-GPT isn't able to install python modules in the docker container they need to be used. Whatever how you run Auto-GPT with docker or with python straight.
For me there are 2 alternatives:
- We could ask to GPT to make a
Dockerfile
ready to go and therequirements.txt
,- Otherwise we need to compute one in Auto-GPT with a
regex
.I have been trying to make a
regex
to find all the import in a file https://github.com/Significant-Gravitas/Auto-GPT/pull/4847/files#diff-3a17cf79b7ab8e6b1ea66d34144971f6bb366c5638a666af493889d91f4cac5aR103regex_imports = re.findall(r"import (.*(?=\n))", code)
It's kind of working...
You might be onto another problem here, that seems to arise when executing python files from AutoGPT outside of docker and needing to install requirements. I was executing with both docker compose and devcontainer, and I was experience the same issue. In my case the problem was that AutoGPT didn't realize that it was in a container and tried to start a new one for the code execution.
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.
⚠️ Search for existing issues first ⚠️
Which Operating System are you using?
MacOS
Which version of Auto-GPT are you using?
Latest Release
Do you use OpenAI GPT-3 or GPT-4?
GPT-3.5
Which area covers your issue best?
Installation and setup
Describe your issue.
During my prompt (write a rap song about coding in the style of Eminem), agent wrote some python codes (not sure why), but is unable to run/execute the file. Leads to a loop and then an error parsing json
[Uploading activity.log…]() error.log
Upload Activity Log Content
No response
Upload Error Log Content
No response