Fix postinst: Install sensorpajen package in venv
The venv had dependencies installed but not the sensorpajen package itself, causing 'No module named sensorpajen' errors when running. Changes: - After installing dependencies from requirements.txt - Now also runs 'pip install --no-deps .' to install sensorpajen - Uses --no-deps to avoid re-installing already-installed dependencies - Installed in /opt/sensorpajen where pyproject.toml exists Fixes: ModuleNotFoundError: No module named 'sensorpajen'
This commit is contained in:
11
debian/postinst
vendored
11
debian/postinst
vendored
@@ -48,7 +48,7 @@ case "$1" in
|
||||
venv/bin/pip install -r /opt/sensorpajen/requirements.txt
|
||||
else
|
||||
echo "Warning: requirements.txt not found, installing bluepy and paho-mqtt directly"
|
||||
venv/bin/pip install bluepy paho-mqtt
|
||||
venv/bin/pip install bluepy paho-mqtt pybluez
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
@@ -56,6 +56,15 @@ case "$1" in
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install sensorpajen package itself
|
||||
echo "Installing sensorpajen application..."
|
||||
cd /opt/sensorpajen
|
||||
venv/bin/pip install --no-deps . || {
|
||||
echo "Error: Failed to install sensorpajen package"
|
||||
exit 1
|
||||
}
|
||||
cd /
|
||||
|
||||
# Set ownership of application directory BEFORE setting capabilities
|
||||
chown -R sensorpajen:sensorpajen /opt/sensorpajen
|
||||
|
||||
|
||||
Reference in New Issue
Block a user