简体   繁体   中英

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. I'm guessing this is due to improper use of 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. 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. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.

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. This usually does happen with improper sudo use, such as running 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. I have noticed that this is a particular issue on Mac especially, though it does happen on other *nix systems as well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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