AutoGPT: Unable to run built docker container: No module named autogpt

Duplicates

  • I have searched the existing issues

Steps to reproduce šŸ•¹

Docker buidl goes perfectly fine, albeit with a lot of warning…

docker run -it --env-file=./.env -v ~/auto_gpt_workspace:/app/auto_gpt_workspace autogpt

gives back:

/usr/local/bin/python: No module named autogpt

I have followed the README exactly. This is a checked out master from some minutes ago.

Current behavior 😯

/usr/local/bin/python: No module named autogpt

Expected behavior šŸ¤”

It should just run, right?

Your prompt šŸ“

# Paste your prompt here

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 33 (11 by maintainers)

Commits related to this issue

Most upvoted comments

For anyone that comes next and is using MacOS:

At the terminal:

  1. download Docker if you don’t already have it
  2. Navigate to where you want the Auto-GPT repository folder to be created, for me this was cd Documents/GitHub/
  3. Clone repository git clone -b stable https://github.com/Significant-Gravitas/Auto-GPT.git
  4. cd into new folder cd Auto-GPT
  5. add these to lines to the Dockerfile, located at the top of the the new Auto-GPT directory, directly below ONBUILD COPY autogpt/ ./autogpt: NBUILD COPY scripts/ ./scripts ONBUILD COPY plugins/ ./plugins
  6. Specify your secrete openAI key in the variable OPENAI_API_KEY in the .env.template file
  7. copy .env.template to .env: cp .env.template .env
  8. build docker image docker compose build auto-gpt NOTE: mac does not use docker-compose syntax
  9. run docker image docker compose run --rm auto-gpt NOTE: mac does not use docker-compose syntax

Again I appreciate your help. I’ll take a look at these resources. My feedback would just be that the ā€œSetup with dockerā€ documentation here https://docs.agpt.co/setup/#set-up-with-docker is a bit misleading. It works for v0.2.2 but not 0.3. Most likely due to the fact that 0.2.2 was using other paths as you mentioned. It would be great if the documentation were updated, or at least a warning added that they will only work for 0.2.2 without additional undocumented steps.

The fix is on the way with #1425

I’m working on an update, just not something that appears of thin air šŸ˜‰

https://github.com/ppetermann/Auto-GPT-DockerSetup this is the setup I’m running, which is a bit more complex, but it works, however there might be some pre-existing docker-knowledge required

Okay thanks for looking and the quick responses.
What do you suggest that we do to run in docker with 0.3 on windows? I’m not sure what you mean by ā€œthe scripts error is related to the production build not including scripts because it assumes you have the folder mountedā€ or how I should go about resolving that issue. Is there a valid docker-compose that we could reference?

this is yaml, not xml

mounting . into /app doesn’t do much with 0.2.2 as 0.2.2 used a different path, hence your local directory is not overwriting whats in the container, hence it will run - not by design though

Maybe this requires a documentation fix. I am following the guide here https://docs.agpt.co/setup/#run-with-docker

It explicitly says to create a docker-compose file with the mount. But based on your explanation it should not. image

However the container still fails with a ModuleNotFoundError when I am not mounting the volume.

I reverted from 0.3 to 0.2.2 and it works. Didn’t really dig in much past that, but might be worth somebody checking that the fix didn’t get reverted in this new release…

guys, that docker-compose.yml mounts the local directory into the container, if you are in another directory, obviously the autogpt subfolder won’t be mounted in. so either you adjust the docker-compose.yml to not mount . to /app OR you run it from a folder that actually has the source.

Thanks for catching that, we should probably remove the volume mount from that template docker-compose.yml

It looks like someone has a pull request in to fix this already #3706 I can build an image locally and run .0.3.0 by adding the additional two lines from that pull request to the dockerfile. That should get me by until it’s merged and the dockerhub image is updated.

Didn’t mean to offend with the documentation comment. I know you guys have your hands full. Just trying to provide constructive feedback.