我第一次尝试通过 PyCharm / VSCode 运行快速启动 flask 应用程序。我的 pip 已完全升级到最新版本,并且我已在 venv 中安装了requirements.txt,但是当我尝试运行它时,我看到此错误。
Traceback (most recent call last):
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\app\__init__.py", line 3, in <module>
from flask import Flask, session, current_app
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\flask\__init__.py", line 2, in <module>
from .app import Flask as Flask
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\flask\app.py", line 15, in <module>
import click
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\app\click\__init__.py", line 1, in <module>
from .utils import create_click_api_client
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\app\click\utils.py", line 1, in <module>
from docusign_click import ApiClient
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\docusign_click\__init__.py", line 19, in <module>
from .apis.accounts_api import AccountsApi
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\docusign_click\apis\__init__.py", line 6, in <module>
from .accounts_api import AccountsApi
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\docusign_click\apis\accounts_api.py", line 24, in <module>
from ..client.api_client import ApiClient
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\docusign_click\client\api_client.py", line 25, in <module>
import jwt
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\jwt\__init__.py", line 1, in <module>
from .api_jwk import PyJWK, PyJWKSet
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\jwt\api_jwk.py", line 7, in <module>
from .algorithms import get_default_algorithms, has_crypto, requires_cryptography
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\jwt\algorithms.py", line 12, in <module>
from .utils import (
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\jwt\utils.py", line 7, in <module>
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\cryptography\hazmat\primitives\asymmetric\ec.py", line 11, in <module>
from cryptography.hazmat._oid import ObjectIdentifier
File "C:\Users\abdul\Downloads\Quickstart App-1-python\Quickstart App-1-python\venv\lib\site-packages\cryptography\hazmat\_oid.py", line 7, in <module>
from cryptography.hazmat.bindings._rust import (
ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
我尝试过以下解决方案:
我无法找到导致此问题的确切 DLL;这些是我的要求.txt:
astroid==3.1.0
certifi==2024.2.2
cffi==1.16.0
chardet==5.2.0
Click
cryptography==42.0.5
docusign-esign==4.0.0rc1
docusign-rooms==1.3.0
docusign-monitor==1.2.0
docusign-click==1.4.0
docusign-admin==1.4.1
docusign-webforms==1.0.2rc12
docusign-maestro==2.0.0rc1
Flask==2.3.3
Flask-OAuthlib==0.9.6
Flask-Session==0.8.0
flask-wtf==1.2.1
flake8==7.0.0
idna==3.7
isort==5.13.2
itsdangerous==2.2.0
Jinja2>=3.1.3
lazy-object-proxy==1.10.0
MarkupSafe==2.1.5
mccabe==0.7.0
oauthlib==2.1.0
pipenv==2023.12.1
py-oauth2==0.0.10
pycparser==2.22
pylint==3.1.0
python-dateutil==2.8.2
python-dotenv==1.0.1
requests>=2.31.0
requests-oauthlib==1.1.0
six==1.16.0
urllib3>=2.2.1
virtualenv==20.25.3
virtualenv-clone==0.5.7
Werkzeug==2.3.8
wrapt==1.16.0
我可以通过哪些方法来研究这个解决方案,或者如果有人遇到类似的错误,如何解决?
正如这里已经提到的如何解决“导入错误:导入_rust ...时DLL加载失败”我还安装了早期版本的加密== 40.0.2并且它有效。