Microsoft MVP성태의 닷넷 이야기
오류 유형: 851. 파이썬 ModuleNotFoundError: No module named '_cffi_backend' [링크 복사], [링크+제목 복사],
조회: 4172
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

파이썬 ModuleNotFoundError: No module named '_cffi_backend'

pymysql을 새롭게 설치해 예제 코드를 실행했더니 이런 오류가 발생하는군요. ^^

Traceback (most recent call last):
  File "/home/testusr/.local/lib/python3.6/site-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/home/testusr/.local/lib/python3.6/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/fastapi/applications.py", line 269, in __call__
    await super().__call__(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/applications.py", line 124, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/middleware/base.py", line 68, in __call__
    response = await self.dispatch_func(request, call_next)
  File "/mnt/d/workshop2/python-agent/jennifer/wrap/middleware_fastapi.py", line 121, in dispatch
    raise err
  File "/mnt/d/workshop2/python-agent/jennifer/wrap/middleware_fastapi.py", line 97, in dispatch
    response = await call_next(request)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/middleware/base.py", line 46, in call_next
    raise app_exc
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/middleware/base.py", line 36, in coro
    await self.app(scope, request.receive, send_stream.send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/exceptions.py", line 93, in __call__
    raise exc
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/exceptions.py", line 82, in __call__
    await self.app(scope, receive, sender)
  File "/home/testusr/.local/lib/python3.6/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
    raise e
  File "/home/testusr/.local/lib/python3.6/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/routing.py", line 670, in __call__
    await route.handle(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/routing.py", line 266, in handle
    await self.app(scope, receive, send)
  File "/home/testusr/.local/lib/python3.6/site-packages/starlette/routing.py", line 65, in app
    response = await func(request)
  File "/home/testusr/.local/lib/python3.6/site-packages/fastapi/routing.py", line 232, in app
    dependant=dependant, values=values, is_coroutine=is_coroutine
  File "/home/testusr/.local/lib/python3.6/site-packages/fastapi/routing.py", line 160, in run_endpoint_function
    return await dependant.call(**values)
  File "./main.py", line 274, in mysql_test
    text3 = test_pymysql_1()
  File "./main.py", line 512, in test_pymysql_1
    con = pymysql.connect(host=mysql_ip, user="...", password="...", database="...", charset='utf8')
  File "/mnt/d/testapp/test.py", line 354, in handler
    raise e
  File "/mnt/d/testapp/test.py", line 344, in handler
    origin_connection = connect(*args, **kwargs)
  File "/home/testusr/.local/lib/python3.6/site-packages/pymysql/connections.py", line 353, in __init__
    self.connect()
  File "/home/testusr/.local/lib/python3.6/site-packages/pymysql/connections.py", line 633, in connect
    self._request_authentication()
  File "/home/testusr/.local/lib/python3.6/site-packages/pymysql/connections.py", line 921, in _request_authentication
    auth_packet = self._process_auth(plugin_name, auth_packet)
  File "/home/testusr/.local/lib/python3.6/site-packages/pymysql/connections.py", line 957, in _process_auth
    return _auth.caching_sha2_password_auth(self, auth_packet)
  File "/home/testusr/.local/lib/python3.6/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 "/home/testusr/.local/lib/python3.6/site-packages/pymysql/_auth.py", line 147, in sha2_rsa_encrypt
    rsa_key = serialization.load_pem_public_key(public_key, default_backend())
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
    from cryptography import utils, x509
  File "/usr/lib/python3/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
    from cryptography.x509.base import (
  File "/usr/lib/python3/dist-packages/cryptography/x509/base.py", line 18, in <module>
    from cryptography.x509.extensions import Extension, ExtensionType
  File "/usr/lib/python3/dist-packages/cryptography/x509/extensions.py", line 20, in <module>
    from cryptography.hazmat.primitives import constant_time, serialization
  File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/constant_time.py", line 11, in <module>
    from cryptography.hazmat.bindings._constant_time import lib
ModuleNotFoundError: No module named '_cffi_backend'

이름이 살짝 다른 cffi 모듈을 설치하시면 됩니다. ^^

python3 -m pip install cffi




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]







[최초 등록일: ]
[최종 수정일: 3/9/2023]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...
NoWriterDateCnt.TitleFile(s)
13207정성태12/26/20224454.NET Framework: 2085. C# - gpedit.msc의 "User Rights Assignment" 특권을 코드로 설정/해제하는 방법파일 다운로드1
13206정성태12/24/20224686.NET Framework: 2084. C# - GetTokenInformation으로 사용자 SID(Security identifiers) 구하는 방법 [3]파일 다운로드1
13205정성태12/24/20225001.NET Framework: 2083. C# - C++과의 연동을 위한 구조체의 fixed 배열 필드 사용 (2)파일 다운로드1
13204정성태12/22/20224299.NET Framework: 2082. C# - (LSA_UNICODE_STRING 예제로) CustomMarshaler 사용법파일 다운로드1
13203정성태12/22/20224474.NET Framework: 2081. C# Interop 예제 - (LSA_UNICODE_STRING 예제로) 구조체를 C++에 전달하는 방법파일 다운로드1
13202정성태12/21/20224915기타: 84. 직렬화로 설명하는 Little/Big Endian파일 다운로드1
13201정성태12/20/20225491오류 유형: 835. PyCharm 사용 시 C 드라이브 용량 부족
13200정성태12/19/20224351오류 유형: 834. 이벤트 로그 - SSL Certificate Settings created by an admin process for endpoint
13199정성태12/19/20224603개발 환경 구성: 656. Internal Network 유형의 스위치로 공유한 Hyper-V의 VM과 호스트가 통신이 안 되는 경우
13198정성태12/18/20224506.NET Framework: 2080. C# - Microsoft.XmlSerializer.Generator 처리 없이 XmlSerializer 생성자를 예외 없이 사용하고 싶다면?파일 다운로드1
13197정성태12/17/20224419.NET Framework: 2079. .NET Core/5+ 환경에서 XmlSerializer 사용 시 System.IO.FileNotFoundException 예외 발생하는 경우파일 다운로드1
13196정성태12/16/20224598.NET Framework: 2078. .NET Core/5+를 위한 SGen(Microsoft.XmlSerializer.Generator) 사용법
13195정성태12/15/20225117개발 환경 구성: 655. docker - bridge 네트워크 모드에서 컨테이너 간 통신 시 --link 옵션 권장 이유
13194정성태12/14/20225162오류 유형: 833. warning C4747: Calling managed 'DllMain': Managed code may not be run under loader lock파일 다운로드1
13193정성태12/14/20225237오류 유형: 832. error C7681: two-phase name lookup is not supported for C++/CLI or C++/CX; use /Zc:twoPhase-
13192정성태12/13/20225241Linux: 55. 리눅스 - bash shell에서 실수 연산
13191정성태12/11/20226144.NET Framework: 2077. C# - 직접 만들어 보는 SynchronizationContext파일 다운로드1
13190정성태12/9/20226641.NET Framework: 2076. C# - SynchronizationContext 기본 사용법파일 다운로드1
13189정성태12/9/20227379오류 유형: 831. Visual Studio - Windows Forms 디자이너의 도구 상자에 컨트롤이 보이지 않는 문제
13188정성태12/9/20226101.NET Framework: 2075. C# - 직접 만들어 보는 TaskScheduler 실습 (SingleThreadTaskScheduler)파일 다운로드1
13187정성태12/8/20225993개발 환경 구성: 654. openssl - CA로부터 인증받은 새로운 인증서를 생성하는 방법 (2)
13186정성태12/6/20224543오류 유형: 831. The framework 'Microsoft.AspNetCore.App', version '...' was not found.
13185정성태12/6/20225520개발 환경 구성: 653. Windows 환경에서의 Hello World x64 어셈블리 예제 (NASM 버전)
13184정성태12/5/20224781개발 환경 구성: 652. ml64.exe와 link.exe x64 실행 환경 구성
13183정성태12/4/20224651오류 유형: 830. MASM + CRT 함수를 사용하는 경우 발생하는 컴파일 오류 정리
13182정성태12/4/20225377Windows: 217. Windows 환경에서의 Hello World x64 어셈블리 예제 (MASM 버전)
... 16  [17]  18  19  20  21  22  23  24  25  26  27  28  29  30  ...