[mythtv] cmake build
Roland Ernst
rcrernst at gmail.com
Thu Jan 23 18:22:43 UTC 2025
On Thu, Jan 23, 2025 at 6:47 PM Peter Bennett <pb.mythtv at gmail.com> wrote:
>
> On 1/23/25 12:30, Roland Ernst wrote:
>
>
> On Thu, Jan 23, 2025 at 6:05 PM Peter Bennett <pb.mythtv at gmail.com> wrote:
>
>>
>> On 1/23/25 11:39, David Hampton wrote:
>>
>> Command Line::
>>
>> cmake --preset qt5 \
>> -DMYTH_BUILD_PLUGINS=OFF \
>> -DCMAKE_INSTALL_PREFIX=/home/peter/proj/build/noble-
>> amd64/mythtv/cmake/usr \
>>
>> & tee ../cmake1.log
>>
>> cmake --build build-qt5 |& tee ../cmake2.log
>>
>> Result:
>>
>> 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.
>>
>> If you wish to install a non-Debian packaged Python application,
>> it may be easiest to use pipx install xyz, which will manage a
>> virtual environment for you. Make sure you have pipx installed.
>>
>> See /usr/share/doc/python3.12/README.venv for more information.
>>
>> 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.
>> [3/3] Completed 'MythTV'
>>
>> I don't see this warning when compiling on my debian 12 or ubuntu 24.04
>> test systems. The former is using the setup.py method, and the later
>> is using the pip method. Which python setup method is your system
>> using? Grep your logfile for the string 'Using python':
>>
>> grep -B 1 'Using python' <logfile>
>>
>> peter at framework:~/proj/github.com/MythTV$ grep -B 1 'Using python'
>> cmake2.log
>> -- Python pip install not available (missing module(s): wheel)
>> -- Using python setup.py install method
>>
>> To fix this I installed a local python environment, and I had to
>> install
>> setuptools:
>>
>> sudo apt install python3-venv
>> # Create virtual environment directory
>> python3 -m venv python
>> # Activate the environment by sourcing the activate script in the
>> environment directory
>> source ~/python/bin/activate
>> # Install packages in to the environment directory
>> pip3 install setuptools
>>
>> After this it built and installed successfully, and I tested it.
>>
>> Something is wrong. You shouldn't have to build in a venv.
>>
>>
>> Maybe i need module "wheel"
>>
>> Peter
>>
>
> Peter,
> on Ubuntu you need the package "python3-pip" ('apt install python3-pip')
> That installs the module "wheel" as dependency.
> On other OS-Distributions, one may need to install "wheel" separately.
> This is handled by mythtv/ansible in a correct way.
> Do not try to install pip, wheel in any other way!
>
> Roland
>
> Something seems to be messed up. I checked with dpkg --list. I do have
> python3-pip and python3-wheel installed already. If i run "pip install" I
> get the long message
>
> 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.
> ..... another several lines suggesting I setup a venv
>
> So why is the cmake build giving that message? It seems cmake is trying to
> run "pip install" but that is not allowed.
>
> If I use the venv I do not have wheel installed, that is why if I use venv
> it uses setup.py and then tells me that is deprecated.
>
> Peter
>
>
It could be that you have two versions of pip installed.
did you run "get-pip.py" or similar "ensurepip" ?
See https://pip.pypa.io/en/stable/installation/
That is not the Debian way and others Distros following Pythons PEP 668.
Note: There are at least two good reason for OS-Maintainers to disallow
the installation of packages via PyPa (i.e. pip): Maintenance and Security.
According python docs, the correct sequence to use pip is
"python3 -m pip". There should not be any executable called 'pip' on your
system.
I will try the cmake building of MythTV over the weekend, hopefully.
On a fresh chroot environment, to ensure it does not make any unwanted
package installations. It is on my list to create Debian packages with
cmake, anyway.
Roland
P.S: Googling for ninja-build and python pip externally managed environment
results to some interesting bug reports. It could be a ninja-build bug as
well.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-dev/attachments/20250123/fa34d07e/attachment.htm>
More information about the mythtv-dev
mailing list