gpt4 book ai didi

python - Satchmo 克隆satchmo.py ImportError : cannot import name execute_manager

转载 作者:太空狗 更新时间:2023-10-29 17:51:42 26 4
gpt4 key购买 nike

我让 satchmo 尝试,但我在第一次尝试时遇到了一个很大的问题,我不明白哪里出了问题。当我将 $ python clonesatchmo.py 制作成清晰的 django 项目时,它会报错:

$ python clonesatchmo.py
Creating the Satchmo Application
Customizing the files
Performing initial data synching
Traceback (most recent call last):
File "manage.py", line 18, in <module>
from django.core.management import execute_manager
ImportError: cannot import name execute_manager
Traceback (most recent call last):
File "manage.py", line 18, in <module>
from django.core.management import execute_manager
ImportError: cannot import name execute_manager
Error: Can not copy the static files.
Error: Can not syncdb.

AND 创建一个存储文件夹。像这样尝试 smth 是有效的!!:

$ python manage.py shell
>>> import os, sys
>>> print sys.executable
/some/path/to/python
>>> os.system('bash')
$ /some/path/to/python manage.py validate
# this is NOT fail on "from django.core.management import execute_manager"

我有 Django 1.6 和 Satchmo 0.9.3,python 2.7.5(我没有使用 virtualenv)

最佳答案

将 manage.py 的内容替换为以下内容(来自新的 django 1.6 项目)。

#!/usr/bin/env python
import os
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "<app>.settings")

from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)

关于python - Satchmo 克隆satchmo.py ImportError : cannot import name execute_manager,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18048232/

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