AutoGPT
AutoGPT copied to clipboard
Invalid syntax with python 3.11.3
Duplicates
- [X] I have searched the existing issues
Steps to reproduce 🕹
Install Python 3.11.3 through Homebrew Follow AutoGPT install instructions: https://autogpt.net/autogpt-installation-and-features/ Run python scripts/main.py
Current behavior 😯
I get the error:
python scripts/main.py File "
", line 1 python scripts/main.py ^^^^^^^ SyntaxError: invalid syntax
Expected behavior 🤔
Run
Your prompt 📝
Run python scripts/main.py
it runs fine on my windows machine with 3.11.3 on the stable branch
Hi @nreck,
The error "SyntaxError: invalid syntax" occurs when there is a syntax mistake in the code. In your case, it seems that you are trying to run the command "python scripts/main.py" in the Python interpreter instead of the command line interface.
You need to open the command prompt or terminal and navigate to the directory where the "main.py" file is located. Then run the command "python main.py" to execute the script.
I hope this helps. Let me know if you have any further queries.
Use 3.10 instead, I have had no success with 3.11
beware on some systems you have to use python3 and not python command to use correct version of python.
it works well on python 3.10, so you must check your python version.
i have many python version on my mac. and the default when i type python
is going to python version 2.7
this is on my local mac.
To solve above issue, i change python inside the run.sh to python3.10 like this :
#!/bin/bash
python scripts/check_requirements.py requirements.txt
if [ $? -eq 1 ]
then
echo Installing missing packages...
pip3.10 install -r requirements.txt
fi
python3.10 -m autogpt $@
read -p "Press any key to continue..."
and it works well
@therzv congratulations :+1:
scripts/main.py
doesn't exist anymore. Check the documentation for instructions on how to run Auto-GPT.