[PATCH v5 08/11] doc: devicetree: Updates for devicetree-rebasing subtree

Paul Barker paul.barker.ct at bp.renesas.com
Fri Feb 16 11:46:50 CET 2024


On 14/02/2024 13:32, Sumit Garg wrote:
> On Wed, 14 Feb 2024 at 03:01, Paul Barker <paul.barker.ct at bp.renesas.com> wrote:
>> On 02/02/2024 13:05, Sumit Garg wrote:
>>> +Dependencies
>>> +~~~~~~~~~~~~
>>> +
>>> +The DT schema project must be installed in order to validate the DT schema
>>> +binding documents and validate DTS files using the DT schema. The DT schema
>>> +project can be installed with pip::
>>> +
>>> +    pip3 install dtschema
>>
>> Unfortunately this won't work on recent distro versions, e.g. on Debian
>> 12 I get:
>>
>>     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.11/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.
>>
>> I don't have a good solution to recommend here - there's no consensus on
>> how to install Python tools for use in development. You could use
>> `pipx`, you could create a virtualenv, and I'm sure there are other
>> options as well. Perhaps we just need to leave it up to the reader to
>> find out how to install dtschema on their system.
> 
> I suppose you haven't installed python3-pip package [1] on your Debian
> 12. BTW, `pip3` is being used as the common way to install dtschema
> [2]. Also, every user may not be aware about python virtual
> environments. So it's better to provide the commonly used pip3 option
> for installation.

The python3-pip package is installed, it's the pip3 program that is
printing the error message I saw. This is the new behaviour in Debian
12, also seen in rolling distributions like Arch Linux and OpenSuSE
Tumbleweed since the middle of last year. There is a good guide to this
from Python=>Speed [1] and more detail in the Python packaging spec [2].
Sadly it's something we now have to live with in recent Linux distro
releases, and I expect all distros will enable this in upcoming
releases.

[1]: https://pythonspeed.com/articles/externally-managed-environment-pep-668/
[2]: https://packaging.python.org/en/latest/specifications/externally-managed-environments/#externally-managed-environments

Thanks,

-- 
Paul Barker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x27F4B3459F002257.asc
Type: application/pgp-keys
Size: 3520 bytes
Desc: OpenPGP public key
URL: <https://lists.denx.de/pipermail/u-boot-custodians/attachments/20240216/1d81b27b/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot-custodians/attachments/20240216/1d81b27b/attachment.sig>


More information about the U-Boot-Custodians mailing list