You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use sudo with a python script installed in /usr/bin. In my case, the script is called ukify. /usr/bin/ukify has the shebang #!/usr/bin/env python3. If I run sudo ukify, I get the following error:
unknown command: python3. Perhaps you have to reshim?
Running python3 or /usr/bin/env python3 without sudo works fine and correctly uses the system python. Running sudo python3 or sudo /usr/bin/env python3 reproduces the issue.
You can work around the issue by using sudo -E, but this is is non-obvious and confusing. It shouldn't be necessary.
This is the same as #1213, which was incorrectly closed.
Steps to Reproduce
asdf local python system
sudo ukify
Expected Behaviour
unknown command: python3. Perhaps you have to reshim?
Actual Behaviour
ukify works normally
Environment
~ ❯ asdf info
OS:
Linux beacon 6.12.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 27 Dec 2024 14:24:37 +0000 x86_64 GNU/Linux
SHELL:
fish, version 3.7.1
BASH VERSION:
5.2.37(1)-release
ASDF VERSION:
v0.14.1
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/home/cooperc/.asdf
ASDF_DIR=/opt/asdf-vm
ASDF_CONFIG_FILE=/home/cooperc/.asdfrc
ASDF INSTALLED PLUGINS:
python https://github.com/danhper/asdf-python.git master 7b0af87
~ ❯ sudo asdf info
OS:
Linux beacon 6.12.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 27 Dec 2024 14:24:37 +0000 x86_64 GNU/Linux
SHELL:
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
BASH VERSION:
5.2.37(1)-release
ASDF VERSION:
v0.14.1
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/root/.asdf
ASDF_DIR=/opt/asdf-vm
ASDF_CONFIG_FILE=/root/.asdfrc
No plugins installed
ASDF INSTALLED PLUGINS:
~ ❯ sudo -E asdf info
OS:
Linux beacon 6.12.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 27 Dec 2024 14:24:37 +0000 x86_64 GNU/Linux
SHELL:
fish, version 3.7.1
BASH VERSION:
5.2.37(1)-release
ASDF VERSION:
v0.14.1
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/home/cooperc/.asdf
ASDF_DIR=/opt/asdf-vm
ASDF_CONFIG_FILE=/home/cooperc/.asdfrc
ASDF INSTALLED PLUGINS:
python https://github.com/danhper/asdf-python.git master 7b0af87
asdf plugins affected (if relevant)
python
The text was updated successfully, but these errors were encountered:
Describe the Bug
I am trying to use
sudo
with a python script installed in /usr/bin. In my case, the script is calledukify
./usr/bin/ukify
has the shebang#!/usr/bin/env python3
. If I runsudo ukify
, I get the following error:Running
python3
or/usr/bin/env python3
without sudo works fine and correctly uses the system python. Runningsudo python3
orsudo /usr/bin/env python3
reproduces the issue.You can work around the issue by using
sudo -E
, but this is is non-obvious and confusing. It shouldn't be necessary.This is the same as #1213, which was incorrectly closed.
Steps to Reproduce
Expected Behaviour
unknown command: python3. Perhaps you have to reshim?
Actual Behaviour
ukify works normally
Environment
asdf plugins affected (if relevant)
python
The text was updated successfully, but these errors were encountered: