Python pip在安装包期间引发异常

Python pip在安装包期间引发异常,python,pip,homebrew,Python,Pip,Homebrew,新手犯了个错误。 我确实在我的mac电脑上安装了自制软件和pip,但在安装过程中出现了一些问题。 例如,对于pip,我的权限被拒绝。我在谷歌上找到了“sudo-H”解决方案。但有一些关于禁用轮子和日志的消息,我不小心退出了终端 有没有命令让pip和Homebrew获得状态报告,比如一切正常,或者删除并重新安装是最好的方法 编辑: 按照建议,尝试在pip和Homebrew中安装软件包,但未安装sudo-h,因此: Exception: Traceback (most recent call las

新手犯了个错误。 我确实在我的mac电脑上安装了自制软件和pip,但在安装过程中出现了一些问题。 例如,对于pip,我的权限被拒绝。我在谷歌上找到了“sudo-H”解决方案。但有一些关于禁用轮子和日志的消息,我不小心退出了终端

有没有命令让pip和Homebrew获得状态报告,比如一切正常,或者删除并重新安装是最好的方法

编辑: 按照建议,尝试在pip和Homebrew中安装软件包,但未安装sudo-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'
但它似乎与Python2.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个问题

请尝试brew安装(此处由您选择软件包)。如果这行得通,那就好了

尝试pip安装(再次选择此处的软件包)。如果这行得通的话,你就可以走了

如果两者都不起作用,请尝试卸载brew和pip,然后重新开始。如果这两种方法都有效,那么你可能很适合去

您还可以熟悉brew cleanup、brew upgrade、brew update和brew doctor等命令


希望能有所帮助。

您会收到一个
权限被拒绝的错误,因为默认情况下
pip
尝试在系统范围内安装其软件包。这里没有不正常的东西

您可以使用
--user
在自己的用户下安装软件包:

pip install --user ...
有没有命令让pip和Homebrew获得状态报告,比如一切正常,或者删除并重新安装是最好的方法


Homebrew有一个
brew doctor
命令,可以帮助您诊断系统上的潜在问题。如果它不能正常工作,这是一个很好的开始
pip
没有这个功能,但它支持一个
-v
选项,用于更详细的输出,最多可以使用三次;e、 g.
pip安装-vvv…

您可以尝试通过自制/pip安装软件包,以查看其是否正常工作…您可以尝试使用brew重新安装命令。尝试安装任何软件包。如果
pip
抛出一个有关文件权限的错误,则该错误无法正常工作。请尝试,检查编辑。您应该使问题标题比“如何检查是否一切正常”更具信息性。