我正在使用Windows
处理Django
项目的64位PyCharm
计算机上。 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
。我应该重新启动机器吗?我missing
申请了INSTALLED_APPS
吗?
我与django_mysql
的目的是使用JSONField
,也许我应该尝试另一个套餐?
答案 0 :(得分:1)
图书馆作者在这里。原来def main():
users=['ari']
passwords=['rycbar1234']
# This is the "title screen"
print('_____This is a password keeper_____')
# checking if the user has an account
actCheck = input('Do you already have an account?')
if actCheck == 'Yes' or actCheck == 'yes':
# asking for user's name and password
yourUser = input('___What is your Username?___')
yourPass = input('___What is your Password?___')
if (yourUser in users and yourPass in passwords):
dirCheck = input('Account settings?[y,n]')
if dirCheck == 'y' or dirCheck == 'Y':
# This is the start of the password/username thing
print('this function is not working yet!')
actSetCheck = input('Change username or password?')
if (
actSetCheck == 'user' or actSetCheck == 'User' or actSetCheck == 'Username' or actSetCheck == 'username'):
yourNewUser = input('What would you like your new username to be?')
elif (
actSetCheck == 'pass' or actSetCheck == 'Pass' or actSetCheck == 'password' or actSetCheck == 'Password'):
yourNewPass = input('What would you like your new password to be?')
elif dirCheck == 'n' or dirCheck == 'N':
request()
# incorrect password thing
else:
print('Incorrect Username or password')
else:
print('This function is not working yet!')
createAct = input('Would you like to create one?')
if createAct == 'yes' or createAct == 'Yes':
createUser = input('What would you like your username to be?')
createPass = input('What would you like your password to be?')
users.append(createUser)
passwords.append(createPass)
else:
main()
main()
在Windows Python发行版中不存在。我已经部署了一个新的Django-MySQL版本1.0.8来处理这个问题。见https://github.com/adamchainz/django-mysql/issues/272