gpt4 book ai didi

python - 我无法在 ubuntu 中使用命令行安装 setuptools。我用过 "pip install setuptools"但它显示错误 :

转载 作者:行者123 更新时间:2023-12-04 19:14:39 25 4
gpt4 key购买 nike

我无法在 ubuntu 中使用命令行安装 setuptools。我使用了“pip install setuptools”,但它显示错误:

Exception:
Traceback (most recent call last):
File "/home/logan/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/logan/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/logan/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/logan/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/logan/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/logan/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/logan/.local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/appdirs.py'

帮帮我,伙计!

最佳答案

您无权更改需要更改的文件。

Permission denied: '/usr/local/lib/python2.7/dist-packages/appdirs.py'

以 root 身份再次运行它,或者在它前面加上 sudo 运行它。要么尝试授予文件夹权限。
su root
pip install setuptools

或者
sudo pip install setuptools 

或者
chmod -R +w /usr/local/lib/python2.7;
pip install setuptools

或者本地安装。您可以使用 --user 标志或 virtualenv (如果已安装)来执行此操作。
pip install --user setuptools

或者
virtualenv <envdir>
source <envdir>/activate
pip install setuptools

关于python - 我无法在 ubuntu 中使用命令行安装 setuptools。我用过 "pip install setuptools"但它显示错误 :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42809696/

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