在Mac上从Pycharm运行品牌新项目获取错误 [英] Getting Error on Running brand New project from Pycharm on Mac

查看:202
本文介绍了在Mac上从Pycharm运行品牌新项目获取错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我非常新的 Django 1.8

我安装了Python 2.7,2.6和3.5

I have install Python 2.7 ,2.6 and 3.5

我尝试用所有版本创建项目。

I tried creating project with all version.

我在 PyCharm中创建了项目使用 Django 一切都可以。

现在我运行这个项目,我有很大的错误

Now I Run the project and I got huge error

/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 /Users/nileshjarad/Python/Django/First/manage.py runserver 8000
Traceback (most recent call last):
  File "/Users/nileshjarad/Python/Django/First/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/core/management/__init__.py", line 190, in fetch_command
    klass = load_command_class(app_name, subcommand)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/core/management/__init__.py", line 40, in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name, name))
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 661, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 3, in <module>
    from django.core.management.commands.runserver import \
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 14, in <module>
    from django.db.migrations.executor import MigrationExecutor
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/migrations/executor.py", line 6, in <module>
    from .loader import MigrationLoader
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/migrations/loader.py", line 10, in <module>
    from django.db.migrations.recorder import MigrationRecorder
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/migrations/recorder.py", line 9, in <module>
    class MigrationRecorder(object):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/migrations/recorder.py", line 23, in MigrationRecorder
    class Migration(models.Model):
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/db/models/base.py", line 309, in __new__
    new_class._meta.apps.register_model(new_class._meta.app_label, new_class)
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/apps/registry.py", line 223, in register_model
    self.clear_cache()
  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/django/apps/registry.py", line 344, in clear_cache
    for model in self.get_models(include_auto_created=True):
TypeError: get_models() missing 1 required positional argument: 'self'

Process finished with exit code 1

帮助我这个错误解决

谢谢。

推荐答案

我从你的错误中看到你有 Python 3.5 安装

As I see from your error you have Python 3.5 install

尝试insatalling Python 3.3 Python 3.4 因为 Djagno 1.8 不支持 Python 3.5

Try insatalling Python 3.3 or Python 3.4 because Djagno 1.8 not supporting Python 3.5

看到这个链接,表格与 Python 和<$ c的不同版本兼容版本兼容$ c> Django

这篇关于在Mac上从Pycharm运行品牌新项目获取错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆