linux – 无法使用pip下载mongo-connector

前端之家收集整理的这篇文章主要介绍了linux – 无法使用pip下载mongo-connector前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用以下命令在Amazon-EC2实例上安装mongo-connector:
pip install mongo-connector

但每次都会出现以下错误

Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py",line 215,in                                                                                         main
    status = self.run(options,args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py",line 31                                                                                        7,in run
    prefix=options.prefix_path,File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py",line 736,in                                                                                         install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py",line 742,in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py",line 1                                                                                        15,in remove
    renames(path,new_path)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py",line 267,in renames
    shutil.move(old,new)
  File "/usr/lib64/python2.7/shutil.py",line 300,in move
    rmtree(src)
  File "/usr/lib64/python2.7/shutil.py",line 252,in rmtree
    onerror(os.remove,fullname,sys.exc_info())
  File "/usr/lib64/python2.7/shutil.py",line 250,in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/dist-packages/request                                                                                        s/sessions.pyo'

我认为这可能是root权限的一些问题,所以我试过:

sudo pip install mongo-connector

但是这说,

sudo: pip: command not found

我使用的是pip 8.1.2,Python 2.7.12.

任何帮助,将不胜感激!

解决方法

我通过使用以下命令解决了这个问题:
sudo `which pip`install mongo-connector

猜你在找的Linux相关文章