代码之家  ›  专栏  ›  技术社区  ›  Steven Matthews

Django CMS安装错误-什么可能导致此错误?

  •  1
  • Steven Matthews  · 技术社区  · 7 年前
    (env) Name-MacBook-Pro-2:site_cms name$ djangocms -f -p . site_cms
    Creating the project
    Please wait while I install dependencies
    If I am stuck for a long time, please check for connectivity / PyPi issues
    Dependencies installed
    Creating the project
    The installation has failed.
    
    
    *****************************************************************
    
    Check documentation at https://djangocms-installer.readthedocs.io
    
    *****************************************************************
    
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.7/bin/djangocms", line 11, in <module>
        sys.exit(execute())
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/djangocms_installer/main.py", line 44, in execute
        django.setup_database(config_data)
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/djangocms_installer/django/__init__.py", line 407, in setup_database
        command, env=env, stderr=subprocess.STDOUT
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 376, in check_output
        **kwargs).stdout
      File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 468, in run
        output=stdout, stderr=stderr)
    subprocess.CalledProcessError: Command '['/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7', '-W', 'ignore', 'manage.py', 'migrate']' returned non-zero exit status 1.
    

    http://docs.django-cms.org/en/develop/introduction/01-install.html

    但是我不确定为什么它没有安装。

    可能是因为Python版本吗?

    这是OSX-High Sierra。我可能需要做些什么让Django CMS连接到我的数据库吗?

    1 回复  |  直到 7 年前
        1
  •  2
  •   ajbeattie    7 年前

    如果其他人遇到这个问题,或者OP没有解决它,我今晚遇到了同样的问题,看起来 python 3.7版 确实是罪魁祸首。

    djangocms公司 (当前)最多只支持 德扬戈1.11 python 3.7版 . Django 1.11 release notes

    我得到的消息是,使用--verbose选项重新运行安装,并看到以下行:

    '%s=%s' % (k, v) for k, v in params.items(),
    ^
    SyntaxError: Generator expression must be parenthesized
    

    一个快速的google搜索似乎证实了这是python3.7/django1.11a的问题 stack overflow

    据djangocms roadmap ,Divio正在主导下一个主要版本的开发,该版本将包括Django 2.0(因此可能还有python3.7)支持。

    同时,你可能还得坚持使用python3.6,因为djangocms的 docs 尽管 tutorial

    祝你好运!