为python安装pip

时间:2014-04-09 20:56:13

标签: python pip

当我运行命令

easy_install pip

我明白了:

error: can't create or remove files in install directory

The following error occurred while trying to add or remove files in the
installation directory:

[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-6775.write-test'

The installation directory you specified (via --install-dir, --prefix, or the distutils default setting) was:

/Library/Python/2.7/site-packages/

我该如何处理这个问题?

1 个答案:

答案 0 :(得分:3)

这有两个解决方案。第一种方法是使用rootsudo为整个系统安装pip

sudo easy_install pip

第二个选项是使用PEP 370中引入的每用户网站包。这可以使用--user选项

来完成
easy_install pip --user