我在运行pip install pokitdok时遇到错误?

时间:2015-03-11 12:41:48

标签: python pip

当我运行> pip install pokitdok时  我得到了以下错误 运行> pip install pokitdok我必须做什么改变

Exception:
      Traceback (most recent call last):
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/basecommand.py", line 232, in main
          status = self.run(options, args)
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/commands/install.py", line 347, in run
          root=options.root_path,
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/req/req_set.py", line 543, in install
          requirement.uninstall(auto_confirm=True)
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/req/req_install.py", line 667, in uninstall
          paths_to_remove.remove(auto_confirm)
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/req/req_uninstall.py", line 126, in remove
          renames(path, new_path)
        File "/usr/local/lib/python2.7/dist-packages/pip-6.0.8-py2.7.egg/pip/utils/__init__.py", line 316, in renames
          shutil.move(old, new)
        File "/usr/lib/python2.7/shutil.py", line 300, in move
          rmtree(src)
        File "/usr/lib/python2.7/shutil.py", line 252, in rmtree
          onerror(os.remove, fullname, sys.exc_info())
        File "/usr/lib/python2.7/shutil.py", line 250, in rmtree
          os.remove(fullname)
      OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/oauthlib/__init__.py'

2 个答案:

答案 0 :(得分:1)

您需要将其安装为root用户,因此请使用sudo

sudo pip install pokitdok

答案 1 :(得分:1)

作为一般规则,如果你绝对必须,你只想提升特权(sudo)。一个很好的选择是使用Python virtualenv,如this question中所述。

当然,如果你只是修修补补,那可能不是什么大问题。