From bdbea2c4dc1775e332968403b4307f2eed87a233 Mon Sep 17 00:00:00 2001 From: MacRimi <123239993+MacRimi@users.noreply.github.com> Date: Mon, 3 Feb 2025 23:31:15 +0100 Subject: [PATCH] Update install_proxmenux.sh --- install_proxmenux.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/install_proxmenux.sh b/install_proxmenux.sh index 424021ec..e342a0a1 100644 --- a/install_proxmenux.sh +++ b/install_proxmenux.sh @@ -100,18 +100,31 @@ done # Set up virtual environment ============================== -msg_info "Setting up the virtual environment for translations..." -if [ ! -d "$VENV_PATH" ]; then - python3 -m venv "$VENV_PATH" +# msg_info "Setting up the virtual environment for translations..." + +#mkdir -p /opt +#chmod 755 /opt + + +if [ ! -d "$VENV_PATH" ] || [ ! -f "$VENV_PATH/bin/activate" ]; then + msg_info "Creating the virtual environment..." + python3 -m venv --system-site-packages "$VENV_PATH" + + if [ ! -f "$VENV_PATH/bin/activate" ]; then msg_error "Failed to create virtual environment. Please check your Python installation." exit 1 fi fi + source "$VENV_PATH/bin/activate" + +pip install --upgrade pip + + if pip install --break-system-packages --no-cache-dir googletrans==4.0.0-rc1; then msg_ok "Virtual environment configured and googletrans installed." else @@ -122,6 +135,7 @@ else exit 1 fi + if [ -n "$VIRTUAL_ENV" ]; then deactivate fi