Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #14959
| From | Marc Glisse <marc.glisse@inria.fr> |
|---|---|
| Newsgroups | linux.debian.maint.python |
| Subject | #!/usr/bin/python3 vs virtualenv |
| Date | 2023-03-03 16:30 +0100 |
| Message-ID | <G5fw5-9OsW-3@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Hello, I recently reported https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032283 , and Dmitry suggested discussing it on this mailing list. Virtual environments work by adding some version of Python (possibly just a symlink to the system one) at the beginning of PATH. Debian policy for Python scripts is to use #!/usr/bin/python3 and **not** #!/usr/bin/env python3, so they are not affected. I think there are 2 types of Python scripts. The first type is applications for end users, like hg or calibre (it is possible that the existence of plugins makes my choice of examples a bad one). If I have some strange Python virtual environment active, I am happy that the Debian policy prevents the virtual environment from breaking those applications (although I may still be able to break them with PYTHONPATH). The second type is targeted at developers, like sphinx-build. If I activate a virtual environment that contains tensorflow, it is because I need `import tensorflow` to work inside sphinx-build, but now the Debian policy prevents it. As discussed in the bug report, there are workarounds. The question here is whether it would make sense to amend the policy for some types of scripts. The answer is probably no, but it seems worth checking what people think. The suggestion to install a copy of sphinx in the virtual environment is a step towards the advice I hear around me but don't really want to follow: "Developers should use conda, system python packages are only for system applications" :-( (thanks a lot to everyone here working on packaging Python stuff in Debian) -- Marc Glisse
Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread
#!/usr/bin/python3 vs virtualenv Marc Glisse <marc.glisse@inria.fr> - 2023-03-03 16:30 +0100
Re: #!/usr/bin/python3 vs virtualenv Danial Behzadi دانیال بهزادی <dani.behzi@ubuntu.com> - 2023-03-03 19:50 +0100
Re: #!/usr/bin/python3 vs virtualenv Jeremy Stanley <fungi@yuggoth.org> - 2023-03-03 20:20 +0100
Re: #!/usr/bin/python3 vs virtualenv Jorge Moraleda <jorge.moraleda@gmail.com> - 2023-03-03 21:30 +0100
Re: #!/usr/bin/python3 vs virtualenv Jeremy Stanley <fungi@yuggoth.org> - 2023-03-03 21:50 +0100
Re: #!/usr/bin/python3 vs virtualenv Jorge Moraleda <jorge.moraleda@gmail.com> - 2023-03-03 22:30 +0100
Re: #!/usr/bin/python3 vs virtualenv Jeremy Stanley <fungi@yuggoth.org> - 2023-03-03 22:50 +0100
Re: #!/usr/bin/python3 vs virtualenv Julian Gilbey <julian@d-and-j.net> - 2023-03-05 11:50 +0100
Re: #!/usr/bin/python3 vs virtualenv Jorge Moraleda <jorge.moraleda@gmail.com> - 2023-03-05 13:00 +0100
Re: #!/usr/bin/python3 vs virtualenv Stefano Rivera <stefanor@debian.org> - 2023-03-09 23:40 +0100
Re: #!/usr/bin/python3 vs virtualenv Marc Glisse <marc.glisse@inria.fr> - 2023-03-05 14:20 +0100
Re: #!/usr/bin/python3 vs virtualenv Dmitry Shachnev <mitya57@debian.org> - 2023-03-03 21:50 +0100
csiph-web