ardupilot_wiki icon indicating copy to clipboard operation
ardupilot_wiki copied to clipboard

Setup: Add venv for Ubuntu Noble (24.04 LTS)

Open TunaLobster opened this issue 1 year ago • 4 comments

This is an update to #5481 for LTS Noble.

Same ideas and problems being solved here.

TunaLobster avatar Aug 30 '24 23:08 TunaLobster

@peterbarker @khancyr awaiting approvals

Hwurzburg avatar Sep 22 '24 12:09 Hwurzburg

@peterbarker @khancyr awaiting approvals

... want to know the impact of --upgrade XYZZY on packages which are not XYZZY and have been pinned

peterbarker avatar Sep 23 '24 09:09 peterbarker

╭─khancyr@MAN-LP-0101 /mnt/c/Documents and Settings/PierreKancir/Downloads/logs
╰─$ sudo pip install -U pymavlink==2.4.13
Requirement already satisfied: pymavlink==2.4.13 in /usr/local/lib/python3.10/dist-packages (2.4.13)
Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from pymavlink==2.4.13) (0.18.3)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink==2.4.13) (4.8.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
╭─khancyr@MAN-LP-0101 /mnt/c/Documents and Settings/PierreKancir/Downloads/logs
╰─$ sudo pip install -U mavproxy
Collecting mavproxy
  Using cached MAVProxy-1.8.71-py3-none-any.whl (7.2 MB)
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3/dist-packages (from mavproxy) (3.5)
Collecting pymavlink>=2.4.14
  Using cached pymavlink-2.4.41-py3-none-any.whl (11.6 MB)
Requirement already satisfied: pynmeagps in /usr/local/lib/python3.10/dist-packages (from mavproxy) (1.0.39)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from mavproxy) (1.21.5)
Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from pymavlink>=2.4.14->mavproxy) (0.18.3)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink>=2.4.14->mavproxy) (4.8.0)
Installing collected packages: pymavlink, mavproxy
  Attempting uninstall: pymavlink
    Found existing installation: pymavlink 2.4.13
    Uninstalling pymavlink-2.4.13:
      Successfully uninstalled pymavlink-2.4.13
Successfully installed mavproxy-1.8.71 pymavlink-2.4.41
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Pining only works for the current cmdline, so any further pip install -U will remove the pining to satisfy the dependency. If you try sudo pip install -U pymavlink==2.4.13 mavproxy it will look for the mavproxy version that is compatibles with the pinned pymavlink

khancyr avatar Sep 23 '24 09:09 khancyr

╭─khancyr@MAN-LP-0101 /mnt/c/Documents and Settings/PierreKancir/Downloads/logs
╰─$ sudo pip install -U pymavlink==2.4.13
Requirement already satisfied: pymavlink==2.4.13 in /usr/local/lib/python3.10/dist-packages (2.4.13)
Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from pymavlink==2.4.13) (0.18.3)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink==2.4.13) (4.8.0)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
╭─khancyr@MAN-LP-0101 /mnt/c/Documents and Settings/PierreKancir/Downloads/logs
╰─$ sudo pip install -U mavproxy
Collecting mavproxy
  Using cached MAVProxy-1.8.71-py3-none-any.whl (7.2 MB)
Requirement already satisfied: pyserial>=3.0 in /usr/lib/python3/dist-packages (from mavproxy) (3.5)
Collecting pymavlink>=2.4.14
  Using cached pymavlink-2.4.41-py3-none-any.whl (11.6 MB)
Requirement already satisfied: pynmeagps in /usr/local/lib/python3.10/dist-packages (from mavproxy) (1.0.39)
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from mavproxy) (1.21.5)
Requirement already satisfied: future in /usr/local/lib/python3.10/dist-packages (from pymavlink>=2.4.14->mavproxy) (0.18.3)
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (from pymavlink>=2.4.14->mavproxy) (4.8.0)
Installing collected packages: pymavlink, mavproxy
  Attempting uninstall: pymavlink
    Found existing installation: pymavlink 2.4.13
    Uninstalling pymavlink-2.4.13:
      Successfully uninstalled pymavlink-2.4.13
Successfully installed mavproxy-1.8.71 pymavlink-2.4.41
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Pining only works for the current cmdline, so any further pip install -U will remove the pining to satisfy the dependency. If you try sudo pip install -U pymavlink==2.4.13 mavproxy it will look for the mavproxy version that is compatibles with the pinned pymavlink

OK, thanks for checking.

I guess I have to withdraw my objections to the one-line thing, 'though it makes it a PITA to work out what the problems are. Could we at least use \ to separate the packages onto separate lines to make it easie to see them all at a glance?

peterbarker avatar Sep 23 '24 10:09 peterbarker

This should be good as is. I think a better way would be to check if the year of the Ubuntu release is greater than 24. That would keep it working on the non-LTS releases too.

TunaLobster avatar Nov 07 '24 03:11 TunaLobster