commands to do "pip install" in docs README file need enhancing
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:
$ pip install sphinx-lint 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.13/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.
Yes, there are solutions, such as using "pipx" instead of "pip", and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.
rday
Quoted 32 lines · Robert P. J. Day
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:$ pip install sphinx-lint 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.13/README.venvfor 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.
Quoted 4 lines
Yes, there are solutions, such as using "pipx" instead of "pip", and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.
Creating a venv like the error suggests (or via uv) is simple enough and IMO best practice for anything like this. You could submit a change to provide short examples, even replacing the references to pipenv earlier in the file.
Quoted 2 lines
rday
Quoted 33 lines · Trevor Gamblin via lists.yoctoproject.org
Quoted 32 lines · Robert P. J. Day
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:$ pip install sphinx-lint 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.13/README.venvfor 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.
Quoted 9 lines
Quoted 4 lines
Yes, there are solutions, such as using "pipx" instead of "pip", and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.Creating a venv like the error suggests (or via uv) is simple enough and IMO best practice for anything like this. You could submit a change to provide short examples, even replacing the references to pipenv earlier in the file.
Quoted 1 line
It's not that simple (though not that difficult). A venv by default is completely isolated and doesn't use anything from the host. The issue is that by doing so, you won't be able to build the docs, only run sphinx-lint, which isn't ideal. You should probably reuse the same venv as documented in documentation/tools/host_packages_scripts/pip3_docs.sh instead.
You probably want to update the instructions for Vale as well. We still support pipenv though, via documentation/Pipfile as far as I remember, so that's another option. Maybe add something in dev-packages for example. No clue, I don't use pipenv.
Cheers,
Quentin
Quoted 51 lines · Quentin Schulz
Quoted 38 lines · Trevor Gamblin via lists.yoctoproject.org
Quoted 32 lines · Robert P. J. Day
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:$ pip install sphinx-lint 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.13/README.venvfor 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.Quoted 4 lines
Yes, there are solutions, such as using "pipx" instead of "pip", and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.Quoted 4 lines
Creating a venv like the error suggests (or via uv) is simple enough and IMO best practice for anything like this. You could submit a change to provide short
examples, even replacing the references to pipenv earlier in the file.It's not that simple (though not that difficult). A venv by default is completely isolated and doesn't use anything from the host. The issue is that by doing so, you won't be able to build the docs, only run sphinx-lint, which isn't ideal. You should probably reuse the same venv as documented in
documentation/tools/host_packages_scripts/pip3_docs.shinstead.
Quoted 4 lines
You probably want to update the instructions for Vale as well. We still support pipenv though, via documentation/Pipfile as far as I remember, so that's another option. Maybe add something in dev-packages for example. No clue, I don't use pipenv.
i just *knew* i would regret asking that question but since this
absolutely *needs* to be resolved so that the instructions in the README work, here's one solution.
forget about venvs (at least for now). the only two packages that
need installation to run the executable commands sphinx-lint and vale are the packages with the same names, and they are special cases since their purpose is to supply those commands, so the simple solution is to install using "pipx", which is designed precisely for that purpose.
one can install pipx with pip, then follow that with:
$ pipx install sphinx-lint $ pipx install vale
and it all now works just fine on debian 13. maybe down the road get fancier with "uv" or whatever but the above will just work, no?
rday
Quoted 58 lines · Robert P. J. Day
Quoted 51 lines · Quentin Schulz
Quoted 38 lines · Trevor Gamblin via lists.yoctoproject.org
Quoted 32 lines · Robert P. J. Day
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:$ pip install sphinx-lint 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.13/README.venvfor 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.Quoted 4 lines
Yes, there are solutions, such as using "pipx" instead of "pip", and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.Quoted 4 lines
Creating a venv like the error suggests (or via uv) is simple enough and IMO best practice for anything like this. You could submit a change to provide short
examples, even replacing the references to pipenv earlier in the file.It's not that simple (though not that difficult). A venv by default is completely isolated and doesn't use anything from the host. The issue is that by doing so, you won't be able to build the docs, only run sphinx-lint, which isn't ideal. You should probably reuse the same venv as documented in
documentation/tools/host_packages_scripts/pip3_docs.shinstead.Quoted 4 lines
You probably want to update the instructions for Vale as well. We still support pipenv though, via documentation/Pipfile as far as I remember, so that's another option. Maybe add something in dev-packages for example. No clue, I don't use pipenv.
Quoted 5 lines
i just *knew* i would regret asking that question but since this
absolutely *needs* to be resolved so that the instructions in the README work, here's one solution.forget about venvs (at least for now). the only two packages that
It's what we tell the user to do to build the docs.
Quoted 11 lines
need installation to run the executable commands sphinx-lint and vale are the packages with the same names, and they are special cases since their purpose is to supply those commands, so the simple solution is to install using "pipx", which is designed precisely for that purpose.
one can install pipx with pip, then follow that with:
$ pipx install sphinx-lint $ pipx install valeand it all now works just fine on debian 13. maybe down the road get
Does it? I tried from within a container. First it tells me the path pipx installed to isn't in PATH so it won't be available. Then it tells me to run pipx ensurepath, which I do, and it then asks me to logoff or source ~/.bashrc. Only then do i have sphinx-lint. What a pain. Then I follow our instructions and install the sphinx packages in a venv:
sh ./documentation/tools/host_packages_scripts/pip3_docs.sh
I then source the venv:
. yocto-docs-venv/bin/activate
and then I run
make sphinx-lint
and you don't have sphinx-lint available. So you either build the docs, or run the linter, but not both without doing some gymnastics...
Quoted 2 lines
fancier with "uv" or whatever but the above will just work, no?
The tool needs to be available in the package feed of all supported distros for us to consider using it I think. I wouldn't want to document installing uv via pip and going into venv inceptions.
How about:
"""
documentation/Pipfile +2 -0
@@ -4,6 +4,8 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] +vale = "*" +sphinx-lint = "*" [packages] sphinx = "*"
documentation/README +10 -10
@@ -127,19 +127,19 @@ to validate the text style. To install Vale: - $ pip install vale + $ pipenv install --dev To run Vale: - $ make stylecheck + $ pipenv run make stylecheck Style checking the whole documentation might take some time and generate a lot of warnings/errors, thus one can run Vale on a subset of files or directories: - $ make stylecheck VALEDOCS=<file> - $ make stylecheck VALEDOCS="<file1> <file2>" - $ make stylecheck VALEDOCS=<dir> + $ pipenv run make stylecheck VALEDOCS=<file> + $ pipenv run make stylecheck VALEDOCS="<file1> <file2>" + $ pipenv run make stylecheck VALEDOCS=<dir> Lint checking the Yocto Project documentation =============================================
@@ -149,19 +149,19 @@ the project uses sphinx-lint (https://github.com/sphinx-contrib/sphinx-lint). To install sphinx-lint: - $ pip install sphinx-lint + $ pipenv install --dev To run sphinx-lint: - $ make sphinx-lint + $ pipenv run make sphinx-lint Lint checking the whole documentation might take some time and generate a lot of warnings/errors, thus one can run sphinx-lint on a subset of files or directories: - $ make sphinx-lint SPHINXLINTDOCS=<file> - $ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>" - $ make sphinx-lint SPHINXLINTDOCS=<dir> + $ pipenv run make sphinx-lint SPHINXLINTDOCS=<file> + $ pipenv run make sphinx-lint SPHINXLINTDOCS="<file1> <file2>" + $ pipenv run make sphinx-lint SPHINXLINTDOCS=<dir> Checking for broken links in the Yocto Project documentation ============================================================
"""
Cheers,
Quentin
Quoted 182 lines · Quentin Schulz
Quoted 61 lines · Robert P. J. Day
Quoted 54 lines · Quentin Schulz
Quoted 39 lines · Trevor Gamblin via lists.yoctoproject.org
Quoted 32 lines · Robert P. J. Day
I just went through this with another Sphinx-based documentation
repo -- installation instructions that advise the reader to install Python modules with "pip install" fail on my Debian 13 system with:$ pip install sphinx-lint 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.13/README.venvfor 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.Quoted 5 lines
Yes, there are solutions, such as using "pipx" instead of "pip",
and
what have you, but it seems that the README file should be augmented with an explanation as to how to deal with the above given that the "pip install" commands are, in some cases, guaranteed to fail.Quoted 6 lines
Creating a venv like the error suggests (or via uv) is simple enough and IMO
best practice for anything like this. You could submit a change to provide
short
examples, even replacing the references to pipenv earlier in the file.It's not that simple (though not that difficult). A venv by default is completely isolated and doesn't use anything from the host. The issue is that by doing so, you won't be able to build the docs, only run sphinx-lint, which isn't ideal. You should probably reuse the same venv as documented in
documentation/tools/host_packages_scripts/pip3_docs.shinstead.Quoted 4 lines
You probably want to update the instructions for Vale as well. We still support pipenv though, via documentation/Pipfile as far as I remember, so that's another option. Maybe add something in dev-packages for example. No clue, I don't use pipenv.
Quoted 5 lines
i just *knew* i would regret asking that question but since this
absolutely *needs* to be resolved so that the instructions in the README work, here's one solution.forget about venvs (at least for now). the only two packages that
It's what we tell the user to do to build the docs.
Quoted 11 lines
need installation to run the executable commands sphinx-lint and vale are the packages with the same names, and they are special cases since their purpose is to supply those commands, so the simple solution is to install using "pipx", which is designed precisely for that purpose.
one can install pipx with pip, then follow that with:
$ pipx install sphinx-lint $ pipx install valeand it all now works just fine on debian 13. maybe down the road get
Does it? I tried from within a container. First it tells me the path pipx installed to isn't in PATH so it won't be available. Then it tells me to run pipx ensurepath, which I do, and it then asks me to logoff or source ~/.bashrc. Only then do i have sphinx-lint. What a pain. Then I follow our instructions and install the sphinx packages in a venv:
sh
./documentation/tools/host_packages_scripts/pip3_docs.shI then source the venv:
. yocto-docs-venv/bin/activate
and then I run
make sphinx-lint
and you don't have sphinx-lint available. So you either build the docs, or run the linter, but not both without doing some gymnastics...
Quoted 2 lines
fancier with "uv" or whatever but the above will just work, no?
The tool needs to be available in the package feed of all supported distros for us to consider using it I think. I wouldn't want to document installing uv via pip and going into venv inceptions.
How about:
"""
documentation/Pipfile +2
-0@@ -4,6 +4,8 @@ url = "https://pypi.org/simple" verify_ssl = true [dev-packages] +vale = "*" +sphinx-lint = "*" [packages] sphinx = "*"documentation/README +5
-5@@ -127,19 +127,19 @@ to validate the text style. To install Vale: - $ pip install vale + $ pipenv install --dev To run Vale: - $ make stylecheck + $ pipenv run make stylecheck Style checking the whole documentation might take some time and generate a lot of warnings/errors, thus one can run Vale on a subset of files or directories: - $ make stylecheck VALEDOCS=<file> - $ make stylecheck VALEDOCS="<file1> <file2>" - $ make stylecheck VALEDOCS=<dir> + $ pipenv run make stylecheck VALEDOCS=<file> + $ pipenv run make stylecheck VALEDOCS="<file1> <file2>" + $ pipenv run make stylecheck VALEDOCS=<dir> Lint checking the Yocto Project documentation =============================================@@ -149,19 +149,19 @@ the project uses sphinx-lint(https://github.com/sphinx-contrib/sphinx-lint).
To install sphinx-lint:
- $ pip install sphinx-lint
+ $ pipenv install --devTo run sphinx-lint:
- $ make sphinx-lint
+ $ pipenv run make sphinx-lintLint checking the whole documentation might take some time and generate a lot of warnings/errors, thus one can run sphinx-lint on a subset of files or directories:
documentation/README +3
-3- $ make sphinx-lint SPHINXLINTDOCS=<file> - $ make sphinx-lint SPHINXLINTDOCS="<file1> <file2>" - $ make sphinx-lint SPHINXLINTDOCS=<dir> + $ pipenv run make sphinx-lint SPHINXLINTDOCS=<file> + $ pipenv run make sphinx-lint SPHINXLINTDOCS="<file1> <file2>" + $ pipenv run make sphinx-lint SPHINXLINTDOCS=<dir> Checking for broken links in the Yocto Project documentation ============================================================
Quoted 4 lines
"""
Cheers,
Quentin
I swear, there are days when I am simply scared to ask what I think
are innocuous questions.
rday
Quoted 3 lines · Quentin Schulz
On 8/20/26 4:58 PM, Robert P. J. Day wrote:
... snip ...
Quoted 10 lines
Quoted 10 lines
need installation to run the executable commands sphinx-lint and vale are the packages with the same names, and they are special cases since their purpose is to supply those commands, so the simple solution is to install using "pipx", which is designed precisely for that purpose.
one can install pipx with pip, then follow that with:
$ pipx install sphinx-lint $ pipx install vale
Quoted 7 lines
Quoted 1 line
and it all now works just fine on debian 13. maybe down the road get
Does it? I tried from within a container. First it tells me the path pipx installed to isn't in PATH so it won't be available. Then it tells me to run pipx ensurepath, which I do, and it then asks me to logoff or source ~/.bashrc. Only then do i have sphinx-lint. What a pain.
FWIW, here's why this just worked for me. on debian 13,/etc/skel/.profile contains:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fiwell, it just so happens that, for whatever reason, on my debian 13 system, i have that directory so that it's automatically added to my search PATH upon login, which is exactly where pipx installs commands like "vale" and "sphinx-lint", so stuff like that just worked for me the instant i installed those two packages with pipx.
rday