gpt4 book ai didi

python - Django 无法安装在虚拟环境中。 (允许)

转载 作者:太空宇宙 更新时间:2023-11-03 15:57:02 24 4
gpt4 key购买 nike

我喜欢在 virtual-env 上安装 django,但出现以下错误。

我只是好奇为什么它试图改变/usr/local/lib/python2.7/dist-packages/django 下的东西。

提前谢谢您。非常感谢您的帮助并投票。

干杯,

(env) mike@mike-VirtualBox:~/Desktop/work/django/estore$ pip install django
Collecting django
Using cached Django-1.10.3-py2.py3-none-any.whl
Installing collected packages: django
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/django'

最佳答案

尝试从您创建的环境的 bin 文件夹中调用 pip 看看是否有效(如下)。您是否为 pip 命令定义了别名。

$ ./env/bin/pip install django

关于python - Django 无法安装在虚拟环境中。 (允许),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40693191/

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