当我这样做时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 numpy
和pip3 install matplotlib
都表明Location: /usr/local/lib/python3.5/dist-packages
。那么和
有什么区别?sudo -H pip install
sudo pip install