我的印象就是那个
pip install --user
会将所选的包放在用户的主目录下。那么为什么以下引用 user 特定目录而不是系统级别 - 例如在Mac上的/Library/Python
?
为了说明:让我们来看看sudo pip install
寻找包裹的位置:
$sudo pip install matplotlib
The directory '/Users/myuser/Library/Caches/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 '/Users/myuser/Library/Caches/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.
Requirement already satisfied: matplotlib in /Users/myuser/Library/Python/2.7/lib/python/site-packages
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /Users/myuser/Library/Python/2.7/lib/python/site-packages (from matplotlib)
Requirement already satisfied: numpy>=1.7.1 in /Users/myuser/Library/Python/2.7/lib/python/site-packages (from matplotlib)
所以它在/Users/myuser
主目录下查看..那么在系统/library
目录下安装的机制是什么?