"sudo python3 -m pip
install -e ."
You’ve already started down a problematic road. I recommend installing
root level Python packages through your system package manager. (apt
for debian, or whatever RedHat is using now).
I’ve never used pkexec. Generally, just use sudo.
Hello,
when I install a package on a GNU/Linux system via "sudo python3 -m pip install -e ." that defines entry points in its pyproject.toml the entry
point starter scripts are located in /usr/locale/bin.
That folder is in PATH for "regular" root users and by "sudo su" roots
users.
But I need to start that entry points via "pkexec".
But in the environment started by "pkexec" the PATH does not contain /usr/local/bin.
So what can I do?
I don't need a hack or workaround but an "elegant" solution.
Dear Gerard,
thank you for your reply.
Am 18.12.2022 19:45 schrieb Weatherby,Gerard:
"sudo python3 -m pip
install -e ."
You’ve already started down a problematic road. I recommend installing
root level Python packages through your system package manager. (apt
for debian, or whatever RedHat is using now).
I'm totally with you at this point.
It is clear for me that distro maintainers sometimes using different mechanics.
But I'm the upstream maintainer and before handing offer a release to
the distro that thing need to run without a distro. And that is pip. I
also know a quit old project using "make" for that.
This question is independent from distros.
I’ve never used pkexec. Generally, just use sudo.
They are two very different things. There is a strict reason why I need
to use pkexec here.
Does it have to be in path? Can't you say
/usr/local/bin/entrypointname? Not sure what constitutes an elegant
solution here.
On 18 Dec 2022, at 17:57, c.buhtz@posteo.jp wrote:
Hello,
when I install a package on a GNU/Linux system via "sudo python3 -m pip install -e ." that defines entry points in its pyproject.toml the entry
point starter scripts are located in /usr/locale/bin.
That folder is in PATH for "regular" root users and by "sudo su" roots
users.
But I need to start that entry points via "pkexec".
But in the environment started by "pkexec" the PATH does not contain /usr/local/bin.
So what can I do?
I don't need a hack or workaround but an "elegant" solution.
--
https://mail.python.org/mailman/listinfo/python-list
Dear Chris,
thank you for your reply.
Am 18.12.2022 20:27 schrieb Chris Angelico:
Does it have to be in path? Can't you say
/usr/local/bin/entrypointname? Not sure what constitutes an elegant
solution here.
I asked that myself. My current solution do determine the full path of
the entrypoint via "which entrypoint".
I also think this is to my current knowledge the best solution.
the which command uses your PATH, so I'm not sure you're buying
anything new there....
Why are asking on this list and discuss.python.org?
Am 18.12.2022 22:37 schrieb Mats Wichmann:
the which command uses your PATH, so I'm not sure you're buying
anything new there....
I'm using which before entering pkexec. ;)
I'll show a demonstrator project later.
Hmm, then I'm not sure what you're *losing* here. The problem, as I understand it, is that the scripts are getting installed into
/usr/local/bin (which is on PATH at the time they're installed), but
pkexec has a restricted PATH. So if you use which before pkexec'ing,
wouldn't you find the scripts, and then be able to run them without
regard to PATH?
Dear Chris,
thanks for asking back and my apologize for being to broad in my way of asking (in a foreign language).
Am 19.12.2022 07:40 schrieb Chris Angelico:
Hmm, then I'm not sure what you're *losing* here. The problem, as I understand it, is that the scripts are getting installed into /usr/local/bin (which is on PATH at the time they're installed), but
pkexec has a restricted PATH. So if you use which before pkexec'ing, wouldn't you find the scripts, and then be able to run them without
regard to PATH?
Absolut correct. This works.
The question is if this is a "good" or "elegant" way from the viewpoint
of different communities/projects (e.g. Python, setuptools, pip, other build-systems, distros, something I forgot).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:37:02 |
Calls: | 6,716 |
Calls today: | 4 |
Files: | 12,246 |
Messages: | 5,357,399 |