gpt4 book ai didi

linux - virtualenv安装linux错误

转载 作者:太空宇宙 更新时间:2023-11-04 04:59:15 27 4
gpt4 key购买 nike

尝试安装 virtualenv 时收到一个有趣的错误:

$ pip install virtualenv

产生以下错误:

Collecting virtualenv
Using cached virtualenv-15.0.2-py2.py3-none-any.whl
Installing collected packages: virtualenv
Exception:
Traceback (most recent call last):
File "/home/matt/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/matt/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/matt/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/matt/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/matt/.local/lib/python2.7/site-packages/pip/wheel.py", line 324, 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/virtualenv.py'

我想知道是否有人对解决这个问题有一些见解?我读到 usr/bin 中可能引用了旧版本的软件,这是可能的,但是这台计算机位于较新的一侧。最好的选择是进入并清除所有对“virtualenv”的引用(我能找到的就是)?

谢谢!

最佳答案

问题在于您尝试将软件包安装到通常需要 root 权限的位置。您可以按照 @Vince West 建议并运行 sudo pip install virtualenv ,或者你可以这样做pip install --user virtualenv ,这会将软件包安装到 ~/.local/lib/python<version>/site-packages 。如果您走这条路,您可能需要确保$HOME/.local/bin包含在您的$PATH中.

关于linux - virtualenv安装linux错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38277635/

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