请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

第一次用pycharm建django项目试运行就出现报错

"C:\Program Files\JetBrains\PyCharm 2018.3.1\bin\runnerw64.exe" C:\Users\hello\Envs\testvir2\Scripts\python.exe C:/Users/hello/PycharmProjects/djangostart/manage.py runserver 8000
Unhandled exception in thread started by <function wrapper at 0x0000000004107B38>
Traceback (most recent call last):
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\core\management\commands\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\utils\autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\apps\registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "c:\python27\Lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Users\hello\Envs\testvir2\lib\site-packages\django\contrib\contenttypes\apps.py", line 7, in <module>
    from .management import update_contenttypes
ImportError: cannot import name update_contenttypes

正在回答 回答被采纳积分+3

2回答

Ethreal 2019-03-10 12:55:41

你是不是用同一个环境跑了多个项目,而且这个contenttype 对model的追踪依赖 建议重新开一个虚拟环境安装django 然后pycharm直接选择环境运行

0 回复 有任何疑惑可以回复我~
bobby 2019-03-10 12:39:26

你的django的版本是多少呢?

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号