我不能在我的覆盆子pi上升级pip

时间:2016-08-11 10:02:09

标签: python pip

我想安装simpleaudio,但不能使用pip升级或安装任何东西,这是它给我的东西:

Downloading/unpacking pip from             https://pypi.python.org/packages/9c/32/004ce0852e0a127f07f358b715015763273799b    d798956fa930814b60f39/pip-8.1.2-py2.py3-none-any.whl#md5=0570520434c5b600d89ec95393b2650b
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
  Found existing installation: pip 1.5.6
    Not uninstalling pip at /usr/lib/python2.7/dist-packages, owned by OS
  Can't roll back pip; was not uninstalled
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python2.7/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 204, 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/pip-8.1.2.dist-info'

Storing debug log for failure in /home/pi/.pip/pip.log

如果有帮助解决这个问题,我会使用Rasop和NOOBS。我刚刚开始学习编程,所以我不知道自从使用上面的指南结果后我需要做什么,所以请向白痴解释一下。

1 个答案:

答案 0 :(得分:1)

pip无法访问某些系统路径,并清楚地显示用户运行pip 的用户没有足够的权限来访问它们。

要解决此问题,请尝试使用sudo以root身份运行这些命令:

sudo pip <options>

否则,如果您没有安装 sudo (这几乎是不可能的),或者您只是好奇并且知道 root &# 39;密码,只需以root身份登录并执行不带sudo的命令:

su # or su root
# type the root's password

pip <options>

如果您使用此选项,在安装完所有内容后不要忘记退出!