Skip to content

Commit

Permalink
Create a virtual environment in a dedicated directory and update the …
Browse files Browse the repository at this point in the history
…PATH for user sessions
  • Loading branch information
KillianLucas committed Dec 4, 2024
1 parent 539fe98 commit ce8de37
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions installers/new-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set -e
REPO_URL="https://github.com/OpenInterpreter/open-interpreter.git"
BRANCH="development"
PYTHON_VERSION="3.12"
VENV_DIR="$HOME/.openinterpreter/venv"

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

# Install package into the venv
echo "Installing package..."
uv pip install --python "$HOME/.openinterpreter/venv/bin/python" "git+$REPO_URL@$BRANCH"
uv pip install --python "$VENV_DIR/bin/python" "git+$REPO_URL@$BRANCH"

# Update PATH for current session and future sessions
export PATH="$VENV_DIR/bin:$PATH"
SHELL_CONFIG="$HOME/.bashrc"
if [[ "$SHELL" == *"zsh"* ]]; then
SHELL_CONFIG="$HOME/.zshrc"
fi
echo "export PATH=\"$VENV_DIR/bin:\$PATH\"" >> "$SHELL_CONFIG"

echo
echo "Installation complete!"

0 comments on commit ce8de37

Please sign in to comment.