Open marceloricciardi opened 1 year ago
I have gotten that error a few times. I resolve it by changing my Python setup, like changing what Python version I'm using. Do you know what version you're using now? And can you change to a different version? Another option is to use GitHub Codespaces.
I have gotten that error a few times. I resolve it by changing my Python setup, like changing what Python version I'm using. Do you know what version you're using now? And can you change to a different version? Another option is to use GitHub Codespaces.
Please, what version of Python are you using? I'm on 3.11 (64 bit).
It just worked for me with Python 3.10 inside a Dev Container. It doesn't work when I use my Mac's standard Python 3.9 installation. I think there may be an issue with the packages installed, there's a number of suggestions in this thread about reinstalling cffi:
https://stackoverflow.com/questions/34370962/no-module-named-cffi-backend
I think it's worth trying those, since Python 3.11 should theoretically be a good version.
It just worked for me with Python 3.10 inside a Dev Container. It doesn't work when I use my Mac's standard Python 3.9 installation. I think there may be an issue with the packages installed, there's a number of suggestions in this thread about reinstalling cffi:
https://stackoverflow.com/questions/34370962/no-module-named-cffi-backend
I think it's worth trying those, since Python 3.11 should theoretically be a good version.
I changed my Python version to 3.10 and the issue is resolved. Thanks @pamelafox !
Okay great. I'm going to send a PR to update the Dev Container to make it more likely for other folks to not run into this issue, for devs using the Dev Container. Keeping this issue open as reference for that PR.
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed.
@pamelafox ... I faced the same issue. There is a scenario for me which can regenerate the error is: I already deployed the code having python 3.10 on my local. Now when I switched to Python 3.11 and ran "start.ps1" I got this error. Also I got same error when I had to add new file in data folder and ran "azd provision" or in general "azd up". So it was calling scripts at the backend.
Now when I uploaded the new document and tried "azd provision" or "azd up", in this scenario I deleted the virtual env, created during the steps. I re-ran the command after deleting virtual env.
In scenario of running, "start.ps1" I faced the same error and i deleted the virtual environment created their as well. I re-ran and it is resolved.
So I found why it is not working in 3.11 and 3.10 only because the libraries in the virtual environment are support for 3.10 initially and when I switched to 3.11 it was not supported because of already installed libraries.
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
ModuleNotFoundError: No module named '_cffi_backend' thread '' panicked at 'Python API call failed', C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\pyo3-0.18.3\src\err\mod.rs:790:5
note: run with
from azure.identity import DefaultAzureCredential
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity__init.py", line 10, in
from ._credentials import (
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_credentials__init.py", line 5, in
from .authorization_code import AuthorizationCodeCredential
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_credentials\authorization_code.py", line 9, in
from .._internal.aad_client import AadClient
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_internal\ init__.py", line 5, in
from .aad_client import AadClient
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_internal\aad_client.py", line 11, in
from .aad_client_base import AadClientBase
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_internal\aad_client_base.py", line 23, in
from .aadclient_certificate import AadClientCertificate
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\azure\identity_internal\aadclient_certificate.py", line 7, in
from cryptography import x509
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\cryptography\x509\ init__.py", line 7, in
from cryptography.x509 import certificate_transparency
File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\backend_env\Lib\site-packages\cryptography\x509\certificate_transparency.py", line 11, in
from cryptography.hazmat.bindings._rust import x509 as rust_x509
pyo3_runtime.PanicException: Python API call failed
RUST_BACKTRACE=1
environment variable to display a backtrace Traceback (most recent call last): File "C:\Users\A556056\OneDrive - Atos\Documents\Projetos\Pessoal\GitHub\azure-search-openai-demo\app\backend\app.py", line 8, inExpected/desired behavior
OS and Version?
azd version?
Versions
Mention any other details that might be useful
I am trying to run locally following the README instructions and using Azure OpenAI in another resource group. Both are in the same subscription and I am the owner/admin.