gpt4 book ai didi

python - djangocms : AttributeError: 'FileNotFoundError' object has no attribute 'cmd'

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

我正在尝试安装 Django CMS在 window 上。我正在使用以下步骤。

C:\Python34\Scripts\pip install djangocms-installer

E:\Projects\example>C:\Python34\Scripts\djangocms -p mysite mysite

但抛出以下错误:

Creating the project
Please wait while I install dependencies


*****************************************************************

Check documentation at https://djangocms-installer.readthedocs.io

*****************************************************************

Traceback (most recent call last):
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 95, in requirements
output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)
File "c:\python34\lib\subprocess.py", line 607, in check_output
with Popen(*popenargs, stdout=PIPE, **kwargs) as process:
File "c:\python34\lib\subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "c:\python34\lib\subprocess.py", line 1114, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\python34\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "c:\python34\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Python34\Scripts\djangocms.exe\__main__.py", line 9, in <module>
File "c:\python34\lib\site-packages\djangocms_installer\main.py", line 33, in
execute
verbose=config_data.verbose
File "c:\python34\lib\site-packages\djangocms_installer\install\__init__.py",
line 98, in requirements
logger.error('cmd : %s :%s' % (e.cmd, e.output))
AttributeError: 'FileNotFoundError' object has no attribute 'cmd'

我已经搜索过了,但找不到任何解决方案。

最佳答案

根本原因是这一行:

output = subprocess.check_output(['pip'] + args, stderr=subprocess.STDOUT)

所以将 PATH 放在 pip 可执行位置,它应该可以工作:

set PATH=%PATH%;C:\Python34\Scripts

乍一看,好像这个包不太适应Windows环境...双重异常不是很好,不带任何路径调用pip会出问题。

关于python - djangocms : AttributeError: 'FileNotFoundError' object has no attribute 'cmd' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41566460/

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