简体   繁体   English

PyCharm无法安装软件包

[英]PyCharm fails to install Packages

Package installs are currently failing no matter what I do. 无论我做什么,软件包安装当前都失败。 I've checked the file permissions, and they were set to read/write so I'm not sure why this directory is not owned by the current user. 我已经检查了文件权限,并且将它们设置为读/写,所以我不确定为什么当前用户不拥有该目录。 I've also ran sudo chown -R $USERNAME /Users/$USERNAME/Library/Caches/pip to no avail. 我还运行了sudo chown -R $USERNAME /Users/$USERNAME/Library/Caches/pip无济于事。 I'm guessing this is due to improper use of Sudo? 我猜这是由于Sudo使用不当造成的? I realize I can install these packages using Sudo through the command line, but I don't want to have to do that each and every time. 我意识到我可以通过命令行使用Sudo安装这些软件包,但是我不想每次都这样做。 Thanks! 谢谢!

40:461: execution error: The directory '/Users/stevennguyen/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. 40:461:执行错误:当前用户不拥有目录'/ Users / stevennguyen / Library / Caches / pip / http'或其父目录,并且缓存已被禁用。 Please check the permissions and owner of that directory. 请检查该目录的权限和所有者。 If executing pip with sudo, you may want sudo's -H flag. 如果使用sudo执行pip,则可能需要sudo的-H标志。

Detailed Image of Error 错误的详细图片

The most likely issue is that you may not own one of the directories above there and it doesn't like that. 最可能的问题是您可能不拥有上面的目录之一,并且不喜欢那样。 I would run sudo chown -R stevennguyen /Users/stevennguyen to ensure that everything in your home directory is owned by you. 我会跑sudo chown -R stevennguyen /Users/stevennguyen以确保你的主目录, 一切归您所有。 This usually does happen with improper sudo use, such as running sudo pip install . 通常在不正确使用sudo时会发生这种情况,例如运行sudo pip install If you want to run pip with root privileges to install a package system wide, you should do as it suggests and run sudo -H pip install so that the ownership of files in your pip directories do not change. 如果要以root特权运行pip以在整个系统范围内安装软件包,则应按照建议执行操作,然后运行sudo -H pip install以使pip目录中文件的所有权不变。 I have noticed that this is a particular issue on Mac especially, though it does happen on other *nix systems as well. 我注意到这是Mac上的一个特殊问题,尽管它在其他* nix系统上也确实发生。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM