Skip to main content
added 222 characters in body
Source Link

You can use sudo -E COMMAND in order to preserve the enviroinment of your user. In your case:

sudo -E python3 --version

If the problem is still here, you can use the following command to override the path only for the selected command:

sudo "PATH=$PATH" python3 --version
# OR
sudo env "PATH=$PATH" python3 --version

You can use sudo -E COMMAND in order to preserve the enviroinment of your user. In your case:

sudo -E python3 --version

You can use sudo -E COMMAND in order to preserve the enviroinment of your user. In your case:

sudo -E python3 --version

If the problem is still here, you can use the following command to override the path only for the selected command:

sudo "PATH=$PATH" python3 --version
# OR
sudo env "PATH=$PATH" python3 --version
Source Link

You can use sudo -E COMMAND in order to preserve the enviroinment of your user. In your case:

sudo -E python3 --version