Skip to content

Commit ce8de37

Browse files
committed
Create a virtual environment in a dedicated directory and update the PATH for user sessions
1 parent 539fe98 commit ce8de37

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

installers/new-installer.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -e
66
REPO_URL="https://github.com/OpenInterpreter/open-interpreter.git"
77
BRANCH="development"
88
PYTHON_VERSION="3.12"
9+
VENV_DIR="$HOME/.openinterpreter/venv"
910

1011
# Install uv if not present
1112
if ! command -v uv > /dev/null 2>&1; then
@@ -25,11 +26,19 @@ uv python install "$PYTHON_VERSION"
2526
# Create virtual environment
2627
echo "Creating virtual environment..."
2728
mkdir -p "$HOME/.openinterpreter"
28-
uv venv --python "$PYTHON_VERSION" "$HOME/.openinterpreter/venv"
29+
uv venv --python "$PYTHON_VERSION" "$VENV_DIR"
2930

3031
# Install package into the venv
3132
echo "Installing package..."
32-
uv pip install --python "$HOME/.openinterpreter/venv/bin/python" "git+$REPO_URL@$BRANCH"
33+
uv pip install --python "$VENV_DIR/bin/python" "git+$REPO_URL@$BRANCH"
34+
35+
# Update PATH for current session and future sessions
36+
export PATH="$VENV_DIR/bin:$PATH"
37+
SHELL_CONFIG="$HOME/.bashrc"
38+
if [[ "$SHELL" == *"zsh"* ]]; then
39+
SHELL_CONFIG="$HOME/.zshrc"
40+
fi
41+
echo "export PATH=\"$VENV_DIR/bin:\$PATH\"" >> "$SHELL_CONFIG"
3342

3443
echo
3544
echo "Installation complete!"

0 commit comments

Comments
 (0)