AutoGPT: ModuleNotFoundError: No module named 'scripts'

⚠️ Search for existing issues first ⚠️

  • I have searched the existing issues, and there is no existing issue for my problem

Which Operating System are you using?

Docker

Which version of Auto-GPT are you using?

Stable (branch)

GPT-3 or GPT-4?

GPT-3.5

Steps to reproduce 🕹

Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal

Docker version 23.0.5, build bc4487a

$ docker pull significantgravitas/auto-gpt

REPOSITORY TAG IMAGE ID CREATED SIZE significantgravitas/auto-gpt latest a1e88fe207ec 3 hours ago 1.65GB redis/redis-stack-server latest 0021013ed7f6 8 days ago 329MB

Current behavior 😯

Traceback (most recent call last): File “/usr/local/lib/python3.10/runpy.py”, line 196, in _run_module_as_main return _run_code(code, main_globals, None, File “/usr/local/lib/python3.10/runpy.py”, line 86, in _run_code exec(code, run_globals) File “/app/autogpt/main.py”, line 5, in <module> autogpt.cli.main() File “/usr/local/lib/python3.10/site-packages/click/core.py”, line 1130, in call return self.main(*args, **kwargs) File “/usr/local/lib/python3.10/site-packages/click/core.py”, line 1055, in main rv = self.invoke(ctx) File “/usr/local/lib/python3.10/site-packages/click/core.py”, line 1635, in invoke rv = super().invoke(ctx) File “/usr/local/lib/python3.10/site-packages/click/core.py”, line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File “/usr/local/lib/python3.10/site-packages/click/core.py”, line 760, in invoke return __callback(*args, **kwargs) File “/usr/local/lib/python3.10/site-packages/click/decorators.py”, line 26, in new_func return f(get_current_context(), *args, **kwargs) File “/app/autogpt/cli.py”, line 87, in main from autogpt.main import run_auto_gpt File “/app/autogpt/main.py”, line 22, in <module> from scripts.install_plugin_deps import install_plugin_dependencies ModuleNotFoundError: No module named ‘scripts’

Expected behavior 🤔

No response

Your prompt 📝

# Paste your prompt here

Your Logs 📒

<insert your logs here>

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 18
  • Comments: 27 (8 by maintainers)

Most upvoted comments

For anyone wondering the exact steps to fix your install right now :

  1. Go into your autogpt folder
  2. Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
  1. Fix the dockerfile :
cd sources
awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
  1. Build the container :
docker build -t autogpt-v0.3.0 .
  1. Fix your docker-compose :
cd ..
sed "s#image: significantgravitas/auto-gpt#image: autogpt-v0.3.0#" docker-compose.yml > tmp; mv tmp docker-compose.yml
  1. Enjoy auto-gpt :
docker-compose run --rm auto-gpt

Thanks @prom3theu5 for the instructions 😃

Even easier than rebuilding docker image, you could just edit docker-compose.yaml and map the scripts and plugins directory. i.e. add - ./scripts:/app/scripts

I am having same issue. It seems that the docker image is not made correctly as it doesn’t seem to have all the files that exist in stable in /app or /app/autogpt

For anyone wondering the exact steps to fix your install right now :

  1. Go into your autogpt folder
  2. Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
  1. Fix the dockerfile :
cd sources
awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
  1. Build the container :
docker build -t autogpt-v0.3.0 .
  1. Fix your docker-compose :
cd ..
sed "s#image: significantgravitas/auto-gpt#image: autogpt-v0.3.0#" docker-compose.yml > tmp; mv tmp docker-compose.yml
  1. Enjoy auto-gpt :
docker-compose run --rm auto-gpt

Thanks @prom3theu5 for the instructions 😃

No idea tbh ^^. They have a lot of open PRs What I would do is take the source download from the 0.3.0 release here: https://github.com/Significant-Gravitas/Auto-GPT/releases/tag/v0.3.0 And add in the two lines in my PR to the dockerfile - then just do docker(/podman) build -t <desired_tag> . from within the extracted folder. That way you can patch yourself while you wait and just build the container locally

Thank you for the follow up @prom3theu5, you’re very kind. I did what you suggested and added the changes from your Open PR locally: #3706

And then ran docker build -t v0.3.0 . as suggested locally, but running auto-gpt still shows up the same ModuleNotFoundError: No module named 'scripts'. Guess I’ll wait until an official fix is up 🙂

You’re very welcome

Aye there was a merge conflict as another pr went in that updated the docker file with the scripts folder too (which is in master and not my pr anymore as that was conflicted)

basically you need to also add

ONBUILD COPY scripts/ ./scripts Same place as you added plug-ins

it’s already merged into master that line, but that was after 0.3.0 and after my original comments here ^^, so release won’t have that

Build the image. If you have pulled the image from Docker Hub, skip this step.

docker-compose build auto-gpt

literally followed the tutorial:

  1. docker pull significantgravitas/auto-gpt
  2. created folder auto-gpt
  3. created file docker-compose.yml as per instructions
  4. added .env file
  5. docker-compose run --rm auto-gpt

same error

No idea tbh ^^. They have a lot of open PRs

What I would do is take the source download from the 0.3.0 release here: https://github.com/Significant-Gravitas/Auto-GPT/releases/tag/v0.3.0 And add in the two lines in my PR to the dockerfile - then just do docker(/podman) build -t <desired_tag> . from within the extracted folder. That way you can patch yourself while you wait and just build the container locally

PowerShell in a python repository! Blasphemy!

With that said, let me grab that fellow PowerShell user.

For anyone wondering the exact steps to fix your install right now :

  1. Go into your autogpt folder
  2. Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
  1. Fix the dockerfile :
cd sources
awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
  1. Build the container :
docker build -t autogpt-v0.3.0 .
  1. Fix your docker-compose :
cd ..
sed "s#image: significantgravitas/auto-gpt#image: autogpt-v0.3.0#" docker-compose.yml > tmp; mv tmp docker-compose.yml
  1. Enjoy auto-gpt :
docker-compose run --rm auto-gpt

Thanks @prom3theu5 for the instructions 😃

Took a while to build but solved my issue 👍 . Thanks!

For all you windows / powershell people out there.

5.Fix the dockerfile:

(Get-Content -Path Dockerfile | ForEach-Object {if($_.ReadCount -eq 39) { "ONBUILD COPY scripts/ ./scripts`nONBUILD COPY plugins/ ./plugins" } $_ }) | Set-Content -Path Dockerfile

7. Fix your docker-compose

(Get-Content -Path Dockerfile | ForEach-Object {if($_.ReadCount -eq 39) { "ONBUILD COPY scripts/ ./scripts`nONBUILD COPY plugins/ ./plugins" } $_ }) | Set-Content -Path Dockerfile

The story seems to continue (significantgravitas/auto-gpt latest bdbf2bfcb8de):

File "/app/autogpt/main.py", line 64, in run_auto_gpt motd, is_new_motd = get_latest_bulletin() File "/app/autogpt/utils.py", line 130, in get_latest_bulletin open("data/CURRENT_BULLETIN.md", "w", encoding="utf-8").write(new_bulletin) FileNotFoundError: [Errno 2] No such file or directory: 'data/CURRENT_BULLETIN.md'

same issue…

No idea tbh ^^. They have a lot of open PRs What I would do is take the source download from the 0.3.0 release here: https://github.com/Significant-Gravitas/Auto-GPT/releases/tag/v0.3.0 And add in the two lines in my PR to the dockerfile - then just do docker(/podman) build -t <desired_tag> . from within the extracted folder. That way you can patch yourself while you wait and just build the container locally

Thank you for the follow up @prom3theu5, you’re very kind. I did what you suggested and added the changes from your Open PR locally: #3706 And then ran docker build -t v0.3.0 . as suggested locally, but running auto-gpt still shows up the same ModuleNotFoundError: No module named 'scripts'. Guess I’ll wait until an official fix is up 🙂

You’re very welcome

Aye there was a merge conflict as another pr went in that updated the docker file with the scripts folder too (which is in master and not my pr anymore as that was conflicted)

basically you need to also add

ONBUILD COPY scripts/ ./scripts Same place as you added plug-ins

it’s already merged into master that line, but that was after 0.3.0 and after my original comments here ^^, so release won’t have that

Worked like a charm. Thank you!

Thanks for being so responsive, would you happen to know what the process is now? When can we expect the image to reflect those changes?