Skip to main content
 首页 » 编程设计

python之尝试使用 pip 为 python 下载 boto

2025年05月04日18傻小

我使用 sudo easy_install pip 安装了 pip,这样我就可以为 python 加载 boto。然后我做了 pip install -U boto 并出现了这个错误

    Installing collected packages: boto 
    Cleaning up... 
    Exception: 
    Traceback (most recent call last): 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main 
        status = self.run(options, args) 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 283, in run 
        requirement_set.install(install_options, global_options, root=options.root_path) 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1435, in install 
        requirement.install(install_options, global_options, *args, **kwargs) 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 671, in install 
        self.move_wheel_files(self.source_dir, root=root) 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 901, in move_wheel_files 
        pycompile=self.pycompile, 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 215, in move_wheel_files 
        clobber(source, lib_dir, True) 
      File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/wheel.py", line 205, in clobber 
        os.makedirs(destdir) 
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs 
        mkdir(name, mode) 
    OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/boto' 
 
    Storing debug log for failure in /Users/DRizzuto/Library/Logs/pip.log 

然后我尝试执行 easy_install boto 并出现此错误

The following error occurred while trying to add or remove files in the 
installation directory: 
 
    [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-2024.write-test' 
 
The installation directory you specified (via --install-dir, --prefix, or 
the distutils default setting) was: 
 
    /Library/Python/2.7/site-packages/ 
 
Perhaps your account does not have write access to this directory?  If the 
installation directory is a system-owned directory, you may need to sign in 
as the administrator or "root" account.  If you do not have administrative 
access to this machine, you may wish to choose a different installation 
directory, preferably one that is listed in your PYTHONPATH environment 
variable. 

我现在不知道怎么安装boto。有人可以解释我如何绕过或消除这些错误吗?

请您参考如下方法:

您需要以 root 身份运行 pip 命令。 (或等效的,即 sudo)

基于Mac的例子

sudo pip install -U boto