2016-03-09 308 views
11

我需要安装一些包。 无论我尝试什么方向,它只会变得更糟。PyCharm:安装包失败

enter image description here

请帮助。

40:497: execution error: The directory '/Users/doekewartena/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/doekewartena/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. Could not find a version that satisfies the requirement path (from versions:) No matching distribution found for path (1)

+0

尝试在bash中用'sudo -H'在bash后面运行pycharm。 – NoOneIsHere

+0

@NoOneIsHere所以你的意思是“sudo -H install string”像这样? – alwaysaskingquestions

+0

@alwaysaskingquestions不,'sudo -H pycharm'。 – NoOneIsHere

回答

6

您是否检查过用户的文件权限包?

您可以运行下面的命令来更改目录(/Users/doekewartena/Library/Caches/pip)的所有权转让给当前用户(doekewartena):

$ sudo chown -R doekewartena /Users/doekewartena/Library/Caches/pip 
+2

该命令后,我仍然有同样的错误。 – clankill3r

+0

我也是!即使在我做了你在这里提到的内容之后,我也有同样的错误... – alwaysaskingquestions

2

pip install --user <package-name>为我工作。

Sudo没有要求。

+0

如何安装软件包取决于个人用户的配置。请考虑重新设计这个答案,使其更加具体。 – axlj