Closed tsawyer closed 11 months ago
Question, what are you installing this on? Is this an AllStarLink image? It almost sounds like you are installing it on something else that has a GUI like a desktop version of Debian or Ubuntu or something similar which has a package manager built in.
Debian 12 has introduced a stricter policy to discourage installing Python packages system-wide with pip, which is why you're encountering the error: externally-managed-environment
. This policy encourages the use of virtual environments, which are a best practice for Python development and deployment since they prevent package conflicts and permission issues.
You're venturing into undocumented land, since I have yet to install/test SkywarnPlus on Debian 12+. Try this, and please report back your experience:
Dependencies
Install the required dependencies using the following commands, and set up a Python virtual environment for SkywarnPlus:
Install system-wide dependencies:
sudo apt install unzip ffmpeg python3 python3-venv python3-pip
Set up a virtual environment for SkywarnPlus:
sudo mkdir -p /usr/local/bin/SkywarnPlus
sudo chown $USER /usr/local/bin/SkywarnPlus
python3 -m venv /usr/local/bin/SkywarnPlus/venv
source /usr/local/bin/SkywarnPlus/venv/bin/activate
pip install ruamel.yaml requests python-dateutil pydub
deactivate
When you want to run scripts that depend on packages in the virtual environment, you must activate it first with the source
command as shown above.
Download SkywarnPlus
Continue with the original instructions for downloading and setting up SkywarnPlus.
cd /usr/local/bin
wget https://github.com/Mason10198/SkywarnPlus/releases/latest/download/SkywarnPlus.zip
unzip SkywarnPlus.zip
rm SkywarnPlus.zip
Configure Permissions
Continue with the original permissions configuration.
cd SkywarnPlus
chmod +x *.py
Edit Configuration
Continue with the original configuration editing steps.
nano config.yaml
Crontab Entry
You will need to modify the crontab entry to activate the Python virtual environment before running the SkywarnPlus script:
Open your crontab file using the crontab -e
command, and add the following line:
* * * * * /usr/local/bin/SkywarnPlus/venv/bin/python /usr/local/bin/SkywarnPlus/SkywarnPlus.py
This will ensure that the correct Python interpreter and dependencies are used when the script runs.
NOTES:
source
command before running any Python commands that depend on the virtual environment's packages.error: externally-managed-environment
issue.I figured out I had to install the Debian packages. The OP is the big clew on that. So...
apt install python3-ruamel.yaml
apt install python3-requests
apt install python3-dateutil
apt install python3-pydub
That did the job. Obviously a one-liner would work but I had to search for and then install the correct package.
I'm up and running. Thanks much for your help and for SkywarnPlus.
If that works OK, then great! Even easier. I can stick that in the README. The instructions I posted here were based on plopping SWP into it's own venv, which I guess is the "right" way to do things nowadays? But that seems excessive for a system that's simply running a node, so I won't complain if it isn't necessary.
Can you verify that SWP operates as intended on your Debian 12 system and let us know, please? 😁
Question, what are you installing this on? Is this an AllStarLink image? It almost sounds like you are installing it on something else that has a GUI like a desktop version of Debian or Ubuntu or something similar which has a package manager built in.
No, not an AllStar image, not a Linux Desktop. Just a Debian 12 server netinstall.
If that works OK, then great! Even easier. I can stick that in the README. The instructions I posted here were based on plopping SWP into it's own venv, which I guess is the "right" way to do things nowadays? But that seems excessive for a system that's simply running a node, so I won't complain if it isn't necessary.
Can you verify that SWP operates as intended on your Debian 12 system and let us know, please? 😁
Yes, it's operating perfectly w/o doing anything different other than the apt install
steps above. I don't do anything other than tail messages so my testing is not exhaustive.
As long as something works, then everything should work. Just wanted to make sure the Python packages worked properly (ruamel
is able to open config file, so that's a yes).
I'll update the README. Thanks!
Good stuff!
pip3 install ruamel.yaml requests python-dateutil pydub
fails withAny recommendations before I start hacking? Yes, I am root user.