Fix AlmaLinux 8 installation: Add python-dotenv to requirements

- Install python-dotenv in virtual environment during CyberPanel setup
- Fixes Django's inability to load .env file on AlmaLinux 8
- Resolves "Access denied for user 'cyberpanel'@'localhost'" errors
- Added to all installation paths (normal, DEV, and after_install)

This ensures Django can properly load database credentials from .env file
on AlmaLinux 8 systems where python-dotenv was missing.
This commit is contained in:
master3395
2026-03-26 01:24:35 +01:00
parent 86912db06e
commit 7588dc5cef
2 changed files with 4 additions and 0 deletions

View File

@@ -68,6 +68,8 @@ rm -rf requirements.txt
wget -O requirements.txt https://raw.githubusercontent.com/usmannasir/cyberpanel/1.8.0/requirments.txt
# Install packages with robust error handling to prevent broken pipe errors
safe_pip_install "pip" "requirements.txt" "--ignore-installed"
# python-dotenv for Django .env loading (upstream f3437739; critical on some AlmaLinux 8 venvs)
pip install python-dotenv 2>/dev/null || echo "⚠️ python-dotenv install skipped or failed"
fi
if [[ $DEV == "ON" ]] ; then
@@ -100,6 +102,7 @@ EOF
fi
safe_pip_install "pip3.6" "requirements.txt" "--ignore-installed"
pip3.6 install python-dotenv 2>/dev/null || echo "⚠️ python-dotenv (pip3.6) install skipped or failed"
fi
if [ -f requirements.txt ] && [ -d cyberpanel ] ; then

View File

@@ -50,6 +50,7 @@ EOF
fi
safe_pip_install "pip3.6" "requirements.txt" "--ignore-installed"
pip3.6 install python-dotenv 2>/dev/null || echo "⚠️ python-dotenv (after_install) skipped or failed"
systemctl restart lscpd
fi