Ubuntu 安装 Boto 错误

Ubuntu Installing Boto error

我已经安装了 Python 2.7.9,我正在尝试使用 pip install boto 安装 Boto,但我收到此错误:

    Collecting boto
  Using cached boto-2.36.0-py2.py3-none-any.whl
Installing collected packages: boto

  Exception:
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 232, in main
      status = self.run(options, args)
    File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 347, in run
      root=options.root_path,
    File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 549, in install
      **kwargs
    File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 754, in install
      self.move_wheel_files(self.source_dir, root=root)
    File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 963, in move_wheel_files
      isolated=self.isolated,
    File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 234, in move_wheel_files
      clobber(source, lib_dir, True)
    File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 205, in clobber
      os.makedirs(destdir)
    File "/usr/lib/python2.7/os.py", line 157, in makedirs
      mkdir(name, mode)
  OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/boto'

我是第一次 Linux/Ubuntu 用户。

尝试运行命令如下:

    sudo pip install boto

首先你需要安装PIP然后安装boto库

如果您想使用 boto v2,请使用

sudo apt-get install python-pip
pip install boto

如果你想安装最新且更强大的 boto v3,请使用以下命令

pip install boto3

如果你正在使用 Python 3 并且想使用最新的 pip 然后使用下面的命令

sudo apt-get install python3-pip
pip3 install boto