ImportError: No module named termios with django_mysql on Windows

ImportError: No module named termios with django_mysql on Windows

我在 64 位 Windows 机器上使用 PyCharm 处理 Django 项目。 Django 1.8.7,Python 2.7.9,MySQL 5.6。我想尝试 django_mysql,但我得到:

Unhandled exception in thread started by <_pydev_bundle.pydev_monkey._NewThreadStartupWithTrace instance at 0x03F8AE90>
Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1\helpers\pydev\_pydev_bundle\pydev_monkey.py", line 551, in __call__
    return self.original_func(*self.args, **self.kwargs)
  File "C:\Users\Admin\test\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Admin\test\lib\site-packages\django\core\management\commands\runserver.py", line 107, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\Admin\test\lib\site-packages\django\utils\autoreload.py", line 252, in raise_last_exception
    six.reraise(*_exception)
  File "C:\Users\Admin\test\lib\site-packages\django\utils\autoreload.py", line 229, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\Admin\test\lib\site-packages\django\__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\Admin\test\lib\site-packages\django\apps\registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "C:\Users\Admin\test\lib\site-packages\django\apps\config.py", line 112, in create
    mod = import_module(mod_path)
  File "c:\python27\Lib\importlib\__init__.py", line 37, in import_module
__import__(name)
  File "C:\Users\Admin\test\lib\site-packages\django_mysql\apps.py", line 5, in <module>
    from .checks import register_checks
  File "C:\Users\Admin\test\lib\site-packages\django_mysql\checks.py", line 8, in <module>
    from django_mysql.utils import collapse_spaces
  File "C:\Users\Admin\test\lib\site-packages\django_mysql\utils.py", line 5, in <module>
    import pty
  File "c:\python27\Lib\pty.py", line 11, in <module>
    import tty
  File "c:\python27\Lib\tty.py", line 5, in <module>
    from termios import *
ImportError: No module named termios

我安装了Cygwin,这似乎对遇到类似问题的人有所帮助,但我仍然遇到此错误。我重新启动了 PyCharm。我应该重新启动机器吗?我 missingINSTALLED_APPS 的某个申请表吗?

我使用 django_mysql 的目的是使用 JSONField,也许我应该尝试另一个包?

这里是图书馆作者。结果 pty 在 Windows Python 发行版中不存在。我已经部署了一个新的 Django-MySQL 版本 1.0.8 来处理这个问题。参见 https://github.com/adamchainz/django-mysql/issues/272