AutoGPT
AutoGPT copied to clipboard
ModuleNotFoundError: No module named 'scripts'
⚠️ Search for existing issues first ⚠️
- [X] 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
Expected behavior 🤔
No response
Your prompt 📝
# Paste your prompt here
Your Logs 📒
<insert your logs here>
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
yes, that seems about right - all the stuff is readily there inside the source tree, it just doesn't seem to be available/found in the docker img
Nothing in the Dockerfile pointing at scripts currently: https://github.com/Significant-Gravitas/Auto-GPT/blob/master/Dockerfile Not sure if there are some lower level helper scripts involved ?
EDIT: And thanks for confirming !
Aye you are right, scripts and plugins (which ultimately scripts needs to exist because install deps doesn't check if the folder exists, just tries to install any zips it finds in the plugins folder) are only copied in the dev builds which just copy entire root into the app folder.
I added them both in #3706
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?
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
running into the same issue with :latest and :v0.3.0 tags
Build the image. If you have pulled the image from Docker Hub, skip this step.
docker-compose build auto-gpt
Build the image. If you have pulled the image from Docker Hub, skip this step.
docker-compose build auto-gpt
literally followed the tutorial:
-
docker pull significantgravitas/auto-gpt
- created folder auto-gpt
- created file docker-compose.yml as per instructions
- added .env file
-
docker-compose run --rm auto-gpt
same error
Sorry if unhelpful, but also having same issue setting auto GPT up for the first time on a brand new Mac OS fresh install on Monterrey on an Apple Silicon chip. Followed instructions to the letter and running auto GPT for the first time yields the same issue on latest v0.3.0 release
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: https://github.com/Significant-Gravitas/Auto-GPT/pull/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 🙂
A workaround for now (not even near to be the best approach) is to use the previous version, this will probably get fix pretty soon as it seems like a critical one (basic docker steps in the documentation are broken).
https://hub.docker.com/layers/significantgravitas/auto-gpt/0.2.2/images/sha256-77ff3a615cb97b0d064ec60174f3657d09d6e75bb5ae3b3523ef16020402a12a?context=explore
I just got it running with 0.2.2
.
It works for initial exploration and playing around with it.
Change the image line in the docker-compose.yml
file to this:
image: significantgravitas/auto-gpt:0.2.2
And for pulling the image use this one instead:
docker pull significantgravitas/auto-gpt:0.2.2
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 locallyThank 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 sameModuleNotFoundError: 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
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 locallyThank 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 sameModuleNotFoundError: 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-insit’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!
same issue...
For anyone wondering the exact steps to fix your install right now :
- Go into your autogpt folder
- Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
- Fix the dockerfile :
cd sources
awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
- Build the container :
docker build -t autogpt-v0.3.0 .
- 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
- Enjoy auto-gpt :
docker-compose run --rm auto-gpt
Thanks @prom3theu5 for the instructions :)
For anyone wondering the exact steps to fix your install right now :
- Go into your autogpt folder
- Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
- Fix the dockerfile :
cd sources awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
- Build the container :
docker build -t autogpt-v0.3.0 .
- 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
- Enjoy auto-gpt :
docker-compose run --rm auto-gpt
Thanks @prom3theu5 for the instructions :)
I don't know what the process is like, but you folks should consider getting involved in the project to help with this Dockerfile stuff and to help update the docker related docs (they're way outdated). You guys have been remarkably helpful and response, thanks !
Hope someone from the inner circle sees that, and you'll get an invite !!
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
Looks like this is fixed in v 0.3.1 #3710
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'
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'
Exactly the same error for me, using the docker image with the 'latest' tag
I suppose, the project needs a few more Docker gurus to help review/maintain this stuff ...
For anyone wondering the exact steps to fix your install right now :
- Go into your autogpt folder
- Clone the V0.3.0 release sources:
git clone -b v0.3.0 https://github.com/Significant-Gravitas/Auto-GPT.git ./sources
- Fix the dockerfile :
cd sources awk 'NR==39{print "ONBUILD COPY scripts/ ./scripts\nONBUILD COPY plugins/ ./plugins"}1' Dockerfile > tmp; mv tmp Dockerfile
- Build the container :
docker build -t autogpt-v0.3.0 .
- 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
- 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
PowerShell in a python repository! Blasphemy!
With that said, let me grab that fellow PowerShell user.
I followed the detailed instructions above to rebuild auto-gpt, but I got the following error:
docker-compose run --rm auto-gpt [+] Running 1/0 ✔ Container autogpt-redis-1 Created 0.0s [+] Running 1/1 ✔ Container autogpt-redis-1 Started 0.4s /usr/local/bin/python: No module named autogpt.main; 'autogpt' is a package and cannot be directly executed
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.