gpt4 book ai didi

python - 在 Python 3.6.2 上部署 Django

转载 作者:行者123 更新时间:2023-11-30 22:31:06 25 4
gpt4 key购买 nike

我已在 Windows 10(64 位)中下载了 Python 3.6.2(64 位)。现在我想使用 Django 框架,所以我想使用 pip 命令下载 Django,但它显示错误。

C:\Windows\system32>pip install django
Collecting django
Using cached Django-1.11.4-py2.py3-none-any.whl
Collecting pytz (from django)
Using cached pytz-2017.2-py2.py3-none-any.whl
Installing collected packages: pytz, django

异常(exception):

Traceback (most recent call last):
File "c:\program files\python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files\python36\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files\python36\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "c:\program files\python36\lib\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\program files\python36\lib\site-packages\pip\wheel.py", line 316, in clobber
ensure_dir(destdir)
File "c:\program files\python36\lib\site-packages\pip\utils\__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "c:\program files\python36\lib\os.py", line 220, in makedirs
mkdir(name, mode)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\python36\\Lib\\site-packages\\pytz'

最佳答案

问题与您选择安装 python 的位置有关,通常它安装在 C:\pythonXX 中,但您的安装在 C:\Program Files\pythonXX 中。这总是会导致问题,您需要始终以管理员身份运行它。快速且最佳的解决方案,卸载并接受在默认位置安装 python - C:\pythonXX

关于python - 在 Python 3.6.2 上部署 Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45908339/

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