vn.py官网
开源量化社区
Member
avatar
加入于:
帖子: 8
声望: 3

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnstation\cli.py", line 90, in run_trader
module = importlib.import_module(d["module"])
File "c:\vnstudio\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\
init.py", line 9, in <module>
from .engine import CtaEngine
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 42, in <module>
from vnpy.trader.database import database_manager
File "c:\vnstudio\lib\site-packages\vnpy\trader\database.py", line 118, in <module>
database_manager: BaseDatabase = import_module(module_name).database_manager
File "c:\vnstudio\lib\importlib\
init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\
init.py", line 1, in <module>
from .mysql_database import database_manager
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\mysql_database.py", line 374, in <module>
database_manager = MysqlDatabase()
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\mysql_database.py", line 134, in
init
self.db.connect()
File "c:\vnstudio\lib\site-packages\peewee.py", line 3080, in connect
self._state.set_connection(self._connect())
File "c:\vnstudio\lib\site-packages\peewee.py", line 3982, in _connect
conn = mysql.connect(db=self.database, **self.connect_params)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 353, in
init__
self.connect()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 633, in connect
self._request_authentication()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 932, in _request_authentication
auth_packet = _auth.caching_sha2_password_auth(self, auth_packet)
File "c:\vnstudio\lib\site-packages\pymysql_auth.py", line 265, in caching_sha2_password_auth
data = sha2_rsa_encrypt(conn.password, conn.salt, conn.server_public_key)
File "c:\vnstudio\lib\site-packages\pymysql_auth.py", line 144, in sha2_rsa_encrypt
"'cryptography' package is required for sha256_password or caching_sha2_password auth methods"
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

请教下,使用mysql数据库,配置好了之后,电脑重启登录后总会出现这个问题,每次都需要手动cmd进入mysql后退出,才能正常登录,怎么回事?谢谢啦。

Member
avatar
加入于:
帖子: 8
声望: 3

ytsky125 wrote:

Traceback (most recent call last):
File "c:\vnstudio\lib\site-packages\vnstation\cli.py", line 90, in run_trader
module = importlib.import_module(d["module"])
File "c:\vnstudio\lib\importlib__init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\
init.py", line 9, in <module>
from .engine import CtaEngine
File "c:\vnstudio\lib\site-packages\vnpy\app\cta_strategy\engine.py", line 42, in <module>
from vnpy.trader.database import database_manager
File "c:\vnstudio\lib\site-packages\vnpy\trader\database.py", line 118, in <module>
database_manager: BaseDatabase = import_module(module_name).database_manager
File "c:\vnstudio\lib\importlib\
init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\
init.py", line 1, in <module>
from .mysql_database import database_manager
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\mysql_database.py", line 374, in <module>
database_manager = MysqlDatabase()
File "c:\vnstudio\lib\site-packages\vnpy\database\mysql\mysql_database.py", line 134, in
init
self.db.connect()
File "c:\vnstudio\lib\site-packages\peewee.py", line 3080, in connect
self._state.set_connection(self._connect())
File "c:\vnstudio\lib\site-packages\peewee.py", line 3982, in _connect
conn = mysql.connect(db=self.database, **self.connect_params)
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 353, in
init__
self.connect()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 633, in connect
self._request_authentication()
File "c:\vnstudio\lib\site-packages\pymysql\connections.py", line 932, in _request_authentication
auth_packet = _auth.caching_sha2_password_auth(self, auth_packet)
File "c:\vnstudio\lib\site-packages\pymysql_auth.py", line 265, in caching_sha2_password_auth
data = sha2_rsa_encrypt(conn.password, conn.salt, conn.server_public_key)
File "c:\vnstudio\lib\site-packages\pymysql_auth.py", line 144, in sha2_rsa_encrypt
"'cryptography' package is required for sha256_password or caching_sha2_password auth methods"
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods

请教下,使用mysql数据库,配置好了之后,电脑重启登录后总会出现这个问题,每次都需要手动cmd进入mysql后退出,才能正常登录,怎么回事?谢谢啦。

搞定了,先pip uninstall enum34,再pip install cryptography就可以了。目前没有发现异常。

© 2015-2019 上海韦纳软件科技有限公司
备案服务号:沪ICP备18006526号-3

沪公网安备 31011502017034号