해결된 질문
작성
·
594
0
파이썬 콘솔에서 아래 오류가 발생했어요...
그래서 , pip install cryptography를 했지만 이미 설치되어 있었구요...
(todos) C:\projects\todos>pip install cryptography
Requirement already satisfied: cryptography in c:\projects\todos\lib\site-packages (41.0.3)
Requirement already satisfied: cffi>=1.12 in c:\projects\todos\lib\site-packages (from cryptography) (1.15.1)
Requirement already satisfied: pycparser in c:\projects\todos\lib\site-packages (from cffi>=1.12->cryptography) (2.21)
아래는 파이썬 콘솔창
user = session.scalar(select(User))
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2023.2.1\plugins\python-ce\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
File "<input>", line 1, in <module>
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\orm\session.py", line 2312, in scalar
return self._execute_internal(
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\orm\session.py", line 2134, in executeinternal
conn = self._connection_for_bind(bind)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\orm\session.py", line 2001, in connectionfor_bind
return trans._connection_for_bind(engine, execution_options)
File "<string>", line 2, in connectionfor_bind
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\orm\state_changes.py", line 139, in _go
ret_value = fn(self, arg, *kw)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\orm\session.py", line 1126, in connectionfor_bind
conn = bind.connect()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\engine\base.py", line 3264, in connect
return self._connection_cls(self)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\engine\base.py", line 145, in init
self._dbapi_connection = engine.raw_connection()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\engine\base.py", line 3288, in raw_connection
return self.pool.connect()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 452, in connect
return ConnectionFairy.checkout(self)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 1267, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 716, in checkout
rec = pool._do_get()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\impl.py", line 169, in doget
with util.safe_reraise():
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\util\langhelpers.py", line 147, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\impl.py", line 167, in doget
return self._create_connection()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 393, in createconnection
return _ConnectionRecord(self)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 678, in init
self.__connect()
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 902, in __connect
with util.safe_reraise():
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\util\langhelpers.py", line 147, in exit
raise exc_value.with_traceback(exc_tb)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\pool\base.py", line 898, in __connect
self.dbapi_connection = connection = pool._invoke_creator(self)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\engine\create.py", line 637, in connect
return dialect.connect(*cargs, **cparams)
File "C:\projects\todos\venv\lib\site-packages\sqlalchemy\engine\default.py", line 615, in connect
return self.loaded_dbapi.connect(*cargs, **cparams)
File "C:\projects\todos\venv\lib\site-packages\pymysql\connections.py", line 358, in init
self.connect()
File "C:\projects\todos\venv\lib\site-packages\pymysql\connections.py", line 664, in connect
self._request_authentication()
File "C:\projects\todos\venv\lib\site-packages\pymysql\connections.py", line 976, in requestauthentication
auth_packet = auth.cachingsha2_password_auth(self, auth_packet)
File "C:\projects\todos\venv\lib\site-packages\pymysql\_auth.py", line 266, in caching_sha2_password_auth
data = sha2_rsa_encrypt(conn.password, conn.salt, conn.server_public_key)
File "C:\projects\todos\venv\lib\site-packages\pymysql\_auth.py", line 143, in sha2_rsa_encrypt
raise RuntimeError(
RuntimeError: 'cryptography' package is required for sha256_password or caching_sha2_password auth methods