2017-09-26 130 views
-1

這裏是菜鳥的錯誤。 我在我的Mac上安裝了Homebrew和pip,但安裝過程中出現了一些複雜情況。 例如,對於pip,我獲得了權限被拒絕。我去Google找到了「sudo-H」解決方案。但是關於停車輪和日誌有一些消息,我意外退出了終端。pip在安裝包時拋出異常

是否有任何命令pip和Homebrew獲取狀態報告,就像一切正常或刪除並重新安裝是最好的方式?

編輯: 嘗試在畫中畫和自制軟件安裝包,所建議的,W/O須藤-h得到這個:

Exception: 
Traceback (most recent call last): 
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main 
status = self.run(options, args) 
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 342, in run 
prefix=options.prefix_path, 
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 784, in install 
**kwargs 
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 851, in install 
self.move_wheel_files(self.source_dir, root=root, prefix=prefix) 
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files 
isolated=self.isolated, 
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files 
clobber(source, lib_dir, True) 
File "/Library/Python/2.7/site-packages/pip/wheel.py", line 323, in clobber 
shutil.copyfile(srcfile, destfile) 
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile 
with open(dst, 'wb') as fdst: 
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/bellite.pyc' 

但似乎涉及到的Python 2.7,這我都不感興趣。所有。

當我用sudo的-h,我得到:

The directory '/Users/SimonOsipov/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/SimonOsipov/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. 

自制安裝包0問題

+0

您可以嘗試通過自制軟件/ pip安裝軟件包以查看它是否正在工作... – Lix

+1

您可以嘗試brew重新安裝命令。 – Pauloscorps

+0

嘗試安裝任何軟件包。如果'pip'引發文件權限錯誤,則表示無法正常工作。 – jdno

回答

0

您收到Permission denied錯誤,因爲默認情況下,pip嘗試在系統範圍內安裝其包。這裏沒有任何工作不正常。

您可以--user下自己的用戶安裝軟件包:

pip install --user ... 

是否有點子和自制軟件的任何命令來獲取狀態報告,好像一切是正確的,或者刪除並重新安裝是最好的方式?

自制軟件有一個brew doctor命令,可以幫助您診斷系統上的潛在問題。如果工作不正常,這是一個很好的開始。 pip沒有,但它支持-v選項可用於更詳細的輸出,最多可以使用三次;例如pip install -vvv ...

0

嘗試釀造安裝(你的選擇包在這裏)。如果有效,那麼這很好。

嘗試pip安裝(再次選擇您的軟件包)。如果這有效,你可能很好走。

如果兩者都不起作用,請嘗試卸載brew和pip,然後重新開始。如果兩者都可以工作,那麼你可能很好。

您還可以熟悉諸如brew清理,brew升級,brew更新和brew醫生等命令。

希望有所幫助。