Update install_proxmenux.sh

This commit is contained in:
MacRimi 2025-02-03 23:31:15 +01:00 committed by GitHub
parent 14f102a4d9
commit bdbea2c4dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,9 +100,17 @@ done
# Set up virtual environment ============================== # Set up virtual environment ==============================
msg_info "Setting up the virtual environment for translations..." # msg_info "Setting up the virtual environment for translations..."
if [ ! -d "$VENV_PATH" ]; then
python3 -m venv "$VENV_PATH"
#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 if [ ! -f "$VENV_PATH/bin/activate" ]; then
msg_error "Failed to create virtual environment. Please check your Python installation." msg_error "Failed to create virtual environment. Please check your Python installation."
@ -110,8 +118,13 @@ if [ ! -d "$VENV_PATH" ]; then
fi fi
fi fi
source "$VENV_PATH/bin/activate" source "$VENV_PATH/bin/activate"
pip install --upgrade pip
if pip install --break-system-packages --no-cache-dir googletrans==4.0.0-rc1; then if pip install --break-system-packages --no-cache-dir googletrans==4.0.0-rc1; then
msg_ok "Virtual environment configured and googletrans installed." msg_ok "Virtual environment configured and googletrans installed."
else else
@ -122,6 +135,7 @@ else
exit 1 exit 1
fi fi
if [ -n "$VIRTUAL_ENV" ]; then if [ -n "$VIRTUAL_ENV" ]; then
deactivate deactivate
fi fi