sudo -H pip install 和 sudo pip install 有什么区别

sudo -H pip install 和 sudo pip install 有什么区别

当我这样做时sudo pip3 install numpy,终端显示:

The directory '/home/tiger/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/tiger/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

它建议我这样做sudo -H,在我输入后终端没有显示任何警告sudo -H pip3 install matplotlib

我输入man sudo,它显示:

-H, --set-home
Request that the security policy set the HOME environment variable to the home directory specified by the target user's password database entry.  Depending on the policy, this may be the default behavior.

pip3 show numpypip3 install matplotlib都表明Location: /usr/local/lib/python3.5/dist-packages。那么和
有什么区别?sudo -H pip installsudo pip install

相关内容