ModuleNotFoundError: No module named 'requests' #309
-
Hello I'm new to python and coding in general. I've installed what I believe are the needed programs / packages However when I try run the autogpt script I get the following output in terminal daviddunn@Mac-mini Auto-GPT % python scripts/main.py I also installed VSC and the python packages there and can seem to run the script from the terminal inside VSC but would like to be able to run this directly inside the mac os terminal without needing to use VSC Any help appreciated.. thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 17 comments 10 replies
-
Check your pip install results - it probably failed due to lack of permission. Try running cmd as admin and install again |
Beta Was this translation helpful? Give feedback.
-
ok after reinstalling python and still experiencing the same problem I noticed the prompt from the python launcher in applications folder was saying python3. Running the following command works python3 scripts/main.py |
Beta Was this translation helpful? Give feedback.
-
I’m having the same trouble even when I add python3 scripts/main.py |
Beta Was this translation helpful? Give feedback.
-
me too, also on mac with homebrew. |
Beta Was this translation helpful? Give feedback.
-
same using mac. |
Beta Was this translation helpful? Give feedback.
-
getting same problem , even after using python3 scripts/main.py |
Beta Was this translation helpful? Give feedback.
-
Wish I could help guys... I just kept installing packages and trying things until it worked. I think I had a similar problem after updating so I reran the requirements.txt which solved it |
Beta Was this translation helpful? Give feedback.
-
Reinstalled it completely. Now seems to be working fine. If you are doing it on Ubuntu, do NOT clone to HOME. That's what helped me |
Beta Was this translation helpful? Give feedback.
-
I use windows 10 and has latest python setup . I did get same problem . which is ModuleNotFoundError: No module named 'requests' . Then i install requests by pip install requests But it didn't solve. new problem was occurring. like : ModuleNotFoundError: No module named 'bs4' The problem was , maybe i didn't run the so basically run the pip install -r requirements.txt into CMD ,which should fix this problem . pip install requests for [ ModuleNotFoundError: No module named 'requests' ] And so on. Install them same way pip install (module name). |
Beta Was this translation helpful? Give feedback.
-
Hi I had exactly the same issue and after trying lots of things I found I had a very old version of the Xcode command line tools installed. See https://mac.install.guide/commandlinetools/7.html for how you can check this, then I removed and installed the updated version and now Auto-GPT works :) |
Beta Was this translation helpful? Give feedback.
-
I am on mac as well. I was able to get all the required modules installed by changing this: "pip install -r requirements.txt" to this: "python3 -m pip install -r requirements.txt" Apparently on my system it runs python v.2 by default, but this forces it to run using version 3. After that I didn't get the "requests" module not found anymore. ALSO, ON the other commands, you need to replace any "python" with "python3"! Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
im having the same issue have tried all the steps everyone posted and no success |
Beta Was this translation helpful? Give feedback.
-
I'm using a virtual environment and run on Mac and none of the solutions above works for me, until I run with another way: docker-compose |
Beta Was this translation helpful? Give feedback.
-
I'm on an old Mac running OS 10.15.7 and it took me ages to get his working. I finally found auto GPT was running in a docker environment. I also found a docker file in the AutoGPT folder named 'Auto-GPT-0.X.X' or whatever version you're running. In the file is a list of all the utilities needed to run AutoGPT. To get it working I had to make sure docker was running and then run the following command in terminal docker build -t python:3-alpine . python:3-alpine is the name of the docker instance, yours might be different. If docker is running and you run AutoGPT it will tell you the name of the docker instance it can see. a couple of other little bugs I needed to fix were adding the following to the docker file RUN alias pip='pip3' so AutoGPT could run commands like 'pip install xxx' without crying about it. you can also add other python modules in the docker file and I find they load quicker than putting them in the requirements.txt file, like below RUN pip install requests Good luck and I hope this saves you the many hours I poured over it. |
Beta Was this translation helpful? Give feedback.
-
I changed the pyyaml==6.0 to 6.0.1 and it all installed. |
Beta Was this translation helpful? Give feedback.
-
pip install package_name --break-system-packages |
Beta Was this translation helpful? Give feedback.
for me the solution seem to be to actually work locally and set this in .env:
EXECUTE_LOCAL_COMMANDS=True