gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 13:15:52 25 4
gpt4 key购买 nike

我正在尝试使用以下命令在 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.2Python 2.7.12

任何帮助将不胜感激!

最佳答案

我使用以下命令解决了这个问题:

sudo `which pip`install mongo-connector

关于linux - 无法使用 pip 下载 mongo-connector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39462909/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com