aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Reinier van der Leer <pwuts@agpt.co> 2023-12-02 14:14:35 +0100
committerGravatar Reinier van der Leer <pwuts@agpt.co> 2023-12-02 14:15:18 +0100
commit6743636996678353e300f335d1e6b634c29ac9c2 (patch)
treead53277e2072558b937d1c2794aaabf55c1eac65
parentfix: fix VCR submodule reference (diff)
downloadAuto-GPT-6743636996678353e300f335d1e6b634c29ac9c2.tar.gz
Auto-GPT-6743636996678353e300f335d1e6b634c29ac9c2.tar.bz2
Auto-GPT-6743636996678353e300f335d1e6b634c29ac9c2.zip
fix: Fix poetry env issues with the agent's entrypoint scripts
- Update autogpt.bat to use `poetry install` instead of `%PYTHON_CMD% -m poetry install` - Update autogpt.sh to use `poetry install` instead of `$PYTHON_CMD -m poetry install` - Use `poetry run` to execute the `autogpt` command in both scripts
-rw-r--r--autogpts/autogpt/autogpt.bat6
-rwxr-xr-xautogpts/autogpt/autogpt.sh16
2 files changed, 10 insertions, 12 deletions
diff --git a/autogpts/autogpt/autogpt.bat b/autogpts/autogpt/autogpt.bat
index 22462f007..12b89f212 100644
--- a/autogpts/autogpt/autogpt.bat
+++ b/autogpts/autogpt/autogpt.bat
@@ -2,7 +2,7 @@
setlocal enabledelayedexpansion
:FindPythonCommand
-for %%A in (python python3) do (
+for %%A in (python3 python) do (
where /Q %%A
if !errorlevel! EQU 0 (
set "PYTHON_CMD=%%A"
@@ -18,10 +18,10 @@ exit /B 1
%PYTHON_CMD% scripts/check_requirements.py
if errorlevel 1 (
echo
- %PYTHON_CMD% -m poetry install --without dev
+ poetry install --without dev
echo
echo Finished installing packages! Starting AutoGPT...
echo
)
-%PYTHON_CMD% -m autogpt %*
+poetry run autogpt %*
pause
diff --git a/autogpts/autogpt/autogpt.sh b/autogpts/autogpt/autogpt.sh
index 9246a433f..57e1f4192 100755
--- a/autogpts/autogpt/autogpt.sh
+++ b/autogpts/autogpt/autogpt.sh
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
function find_python_command() {
- if command -v python &> /dev/null
- then
- echo "python"
- elif command -v python3 &> /dev/null
+ if command -v python3 &> /dev/null
then
echo "python3"
+ elif command -v python &> /dev/null
+ then
+ echo "python"
else
echo "Python not found. Please install Python."
exit 1
@@ -16,16 +16,14 @@ function find_python_command() {
PYTHON_CMD=$(find_python_command)
if $PYTHON_CMD -c "import sys; sys.exit(sys.version_info < (3, 10))"; then
- $PYTHON_CMD scripts/check_requirements.py
- if [ $? -eq 1 ]
- then
+ if ! $PYTHON_CMD scripts/check_requirements.py; then
echo
- $PYTHON_CMD -m poetry install --without dev
+ poetry install --without dev
echo
echo "Finished installing packages! Starting AutoGPT..."
echo
fi
- $PYTHON_CMD -m autogpt "$@"
+ poetry run autogpt "$@"
else
echo "Python 3.10 or higher is required to run Auto GPT."
fi