stephendade / Rpanion-server

Web-based configurator for companion computers of MAVLink vehicles
https://www.docs.rpanion.com/software/rpanion-server
GNU General Public License v3.0
146 stars 62 forks source link

error: externally-managed-environment #252

Closed lida2003 closed 1 month ago

lida2003 commented 1 month ago

Test environment:

commit 377423757e0c2151994dd9b02f0d7a191c15e122 (HEAD -> master, origin/master, origin/HEAD)
Author: Stephen Dade <stephen_dade@hotmail.com>
Date:   Sun Sep 8 20:28:49 2024 +1000

    Tests: fix CodeQL failures

Error when install:

I got below error when install from RasPi2-3-4-5-deploy.sh

+ source /etc/os-release
++ PRETTY_NAME='Raspbian GNU/Linux 12 (bookworm)'
++ NAME='Raspbian GNU/Linux'
++ VERSION_ID=12
++ VERSION='12 (bookworm)'
++ VERSION_CODENAME=bookworm
++ ID=raspbian
++ ID_LIKE=debian
++ HOME_URL=http://www.raspbian.org/
++ SUPPORT_URL=http://www.raspbian.org/RaspbianForums
++ BUG_REPORT_URL=http://www.raspbian.org/RaspbianBugs
+ '[' raspbian == debian ']'
+ sudo python3 -m pip install --upgrade pip
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Root cause for the issue:

The problem is here pip3 install: ID=raspbian VERSION_CODENAME=bookworm

https://github.com/stephendade/Rpanion-server/blob/377423757e0c2151994dd9b02f0d7a191c15e122/deploy/install_common_libraries.sh#L26-L32

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 12 (bookworm)"
NAME="Raspbian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Here is a simple fix, which need to be further tested with other board/system:

lida2003 commented 1 month ago

bullseye + raspberry pi 3b+ tested OK.

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

There is no below omx encoder issue:

Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_omx))
[h264_omx @ 0x9d68c0] libOMX_Core.so not found
[h264_omx @ 0x9d68c0] libOmxCore.so not found
lida2003 commented 1 month ago

https://github.com/stephendade/Rpanion-server/pull/251 closed