2016-03-09 285 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