Hi Marc! On Thu, Mar 02, 2023 at 11:21:06PM +0100, Marc Glisse wrote: > Dear Maintainer, > > I used to install tensorflow with pip, and sphinx-build had no trouble > building my documentation which includes `import tensorflow`. > > Since we are not supposed to use pip directly anymore, I created a > virtual environment, with the option --system-site-packages since I only > want to add a few things not packaged in Debian, and installed > tensorflow in it. I now activate the environment, run sphinx-build, > and... it fails to find tensorflow. > > The issue is that sphinx-build starts with #!/usr/bin/python3 , it does > not use the python3 symlink that the activation added at the beginning > of PATH, and thus does not look for packages in my active virtual > environment.
As you noted, /usr/bin/python3 shebang is part of the Debian Python Policy: https://www.debian.org/doc/packaging-manuals/python-policy/#interpreter-directive-shebang https://www.debian.org/doc/packaging-manuals/python-policy/#interpreter-location > I have many possible workarounds: > * execute python3 -m sphinx.cmd.build > * execute python3 /usr/bin/sphinx-build > * export a PYTHONPATH pointing to the virtual environment > * install another copy of sphinx in the virtual environment > etc I would just install another copy of Sphinx in a virtualenv. This will also help pip to make sure all packages are compatible with each other. I don't think your use case deserves changing the policy, but it's better to discuss it on debian-python, maybe there are other opinions. -- Dmitry Shachnev
signature.asc
Description: PGP signature

