Sudo PATHgüvenlik nedenleriyle mevcut kullanıcınızla aynı şeyi kullanmıyor . Burada sudo ile komutları çalıştırırken kullanılan yolu belirten /etc/sudoersbir seçenek secure_pathvardır. Benimki şöyle:
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
Sudo man sayfasından:
secure_path Path used for every command run from sudo. If you don't trust the people running sudo to have a sane PATH environment
variable you may want to use this. Another use is if you want to have the “root path” be separate from the “user path”.
Users in the group specified by the exempt_group option are not affected by secure_path. This option is not set by
default.
pip3Komut tarafından tanımlanan yol muhtemelen değildir sudoersdosyası. Komuta secure_pathgiden yolu ekleyebilir veya pip3komutun tam yolunu şu şekilde sağlayabilirsiniz :
sudo /path/to/pip3 install django