已有184人关注
创建项目时在PyCharm中终端的运行django-admin startproject demo报错
还有0人有此问题
发表在Python图书答疑 2022-04-05 《Python编程入门指南》
是否精华
版块置顶:

(venv) PS C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject> django-admin startproject demo

Traceback (most recent call last):

  File "E:\Python\lib\runpy.py", line 196, in _run_module_as_main

    return _run_code(code, main_globals, None,

  File "E:\Python\lib\runpy.py", line 86, in _run_code

    exec(code, run_globals)

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\Scripts\django-admin.exe\__main__.py", line 4, in <module>

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\core\management\__init__.py", line 13, in <module>

    from django.core.management.base import (

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\core\management\base.py", line 17, in <module>

    from django.db.migrations.exceptions import MigrationSchemaMissing

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\migrations\__init__.py", line 2, in <module>

    from .operations import *  # NOQA

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\migrations\operations\__init__.py", line 1, in <module>

    from .fields import AddField, AlterField, RemoveField, RenameField

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\migrations\operations\fields.py", line 3, in <module>

    from django.db.models.fields import NOT_PROVIDED

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\models\__init__.py", line 5, in <module>

    from django.db.models.deletion import (

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\models\deletion.py", line 5, in <module>

    from django.db.models import signals, sql

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\models\sql\__init__.py", line 2, in <module>

    from django.db.models.sql.query import *  # NOQA

  File "C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject\venv\lib\site-packages\django\db\models\sql\query.py", line 11, in <module>

    from collections import Counter, Iterator, Mapping, OrderedDict

ImportError: cannot import name 'Iterator' from 'collections' (E:\Python\lib\collections\__init__.py)

(venv) PS C:\Users\Administrator\Desktop\pythonstudy\Code\Webproject> 


分享到:
精彩评论 3
盗墓笔记
学分:13 LV2
2022-04-05
沙发

不能创建新项目

无语_mrkj
学分:3155 LV11
2022-04-06
板凳

请问您使用的Python是什么版本?这个命令不支持Python 3.10,需要更换低版本。

game99258
学分:2266 LV10
2022-07-10
地板

吃个坚果就可以了

首页上一页 1 下一页尾页 3 条记录 1/1页
手机同步功能介绍
友情提示:以下图书配套资源能够实现手机同步功能
明日微信公众号
明日之星 明日之星编程特训营
客服热线(每日9:00-17:00)
400 675 1066
mingrisoft@mingrisoft.com
吉林省明日科技有限公司Copyright ©2007-2022,mingrisoft.com, All Rights Reserved长春市北湖科技开发区盛北大街3333号长春北湖科技园项目一期A10号楼四、五层
吉ICP备10002740号-2吉公网安备22010202000132经营性网站备案信息 营业执照