2017-09-26 132 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医生等命令。

希望有所帮助。