shane-mason / FieldStation42

Broadcast TV simulator
Mozilla Public License 2.0
74 stars 6 forks source link

cannot install moviepy and python-mpv-jsonipc #5

Closed socialtwisty closed 3 days ago

socialtwisty commented 2 weeks ago

I must be missing something, but for the Install-dep.sh does anyone else encounter this?

image

shane-mason commented 2 weeks ago

You will need to run as sudo to install, or you can use a virtual environment to install packages just just for yourself. You can run the install dep like this and it should work:

sudo sh Install-dep.sh

socialtwisty commented 2 weeks ago

Thanks for the reply. I was running as root, but also tried sudo as regular user, and also gave pip3 a try but nothing seemed to work. I wasn't sure what sort of extra grief a virtual environment would bring, so I just tried --break-system-packages and i was able to import them in the python interpreter. I'll see how that goes and revisit the virtual environment if things still don't work. my experiences with python related projects are pretty limited

shane-mason commented 2 weeks ago

oh - I see it now in your original message: its a managed install. You either HAVE to use the virtual environment or you have to install packages like this:

sudo apt install python3-moviepy

assuming that someone made a package with that - which they probably didn't. I think the easiest (and recommended route) is the virtual environment - Its not that difficult to set one up, but I'll update the documentation.

socialtwisty commented 2 weeks ago

image

I think I must have screwed up my install somehow. It was a fresh install of the full-fat July 4th 2024 release of Raspberry Pi OS 64bit on a Pi4 with apt update and apt upgrade performed. In any case, I think I managed to get the dependencies installed as I can import them within python, but if not I'll blow it away with a fresh install and if that doesn't work I'll try the virtual environment as you suggested.

shane-mason commented 2 weeks ago

I don't think you messed up your install, I think that might be how it works in recent versions. Unless its a major python package, there wont be an apt package for you. I recommend biting the bullet and making a virtual env:

python3 -m venv /path/to/new/virtual/environment

to use it, just run this in your shell:

source /path/to/new/virtual/environment/bin/activate

you'll note that which python3 and which pip3 now points to the virtual bin path.

shane-mason commented 3 days ago

I have added a new install script that handles making the virtual env and installing dependencies. This should resolve your issue. Have a look at it and the new wiki documentation on the installation process.

shane-mason commented 3 days ago

New install script and wiki should resolve most installation issues.