From cryptography.hazmat.bindings._rust import ( ImportError: DLL load failed while importing _rust: The specified procedure could not be found

Hi, I’ve encountered this error while first trying to train my rasa model. I have ensured that I’ve implemented this in a virtual environment, checked the compatibility of the python version (3.9) and my pip version (20.2.3). It seems like rasa had been properly installed, but this error seems to persist.

Any assistance on this would be deeply appreciated! Thank you.

This is the full traceback call-

Traceback (most recent call last): File “C:\Users\MuhammedMuzzammil\AppData\Local\Programs\Python\Python39\lib\runpy.py”, line 197, in run_module_as_main return run_code(code, main_globals, None, File “C:\Users\MuhammedMuzzammil\AppData\Local\Programs\Python\Python39\lib\runpy.py”, line 87, in run_code exec(code, run_globals) File "C:\Users\MuhammedMuzzammil\Desktop\Again\venv\Scripts\rasa.exe_main.py", line 7, in File "c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa_main.py", line 133, in main cmdline_arguments.func(cmdline_arguments) File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\cli\scaffold.py”, line 238, in run init_project(args, path) File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\cli\scaffold.py”, line 132, in init_project print_train_or_instructions(args) File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\cli\scaffold.py”, line 64, in print_train_or_instructions training_result = rasa.train( File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\api.py”, line 103, in train from rasa.model_training import train File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\model_training.py”, line 7, in import rasa.engine.validation File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\engine\validation.py”, line 33, in from rasa.engine.constants import RESERVED_PLACEHOLDERS File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\engine\constants.py”, line 3, in from rasa.core.channels import UserMessage File "c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\core\channels_init.py", line 3, in from rasa.core.channels.channel import ( # noqa: F401 File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\rasa\core\channels\channel.py”, line 4, in import jwt File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\jwt_init_.py”, line 1, in from .api_jwk import PyJWK, PyJWKSet File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\jwt\api_jwk.py”, line 7, in from .algorithms import get_default_algorithms, has_crypto, requires_cryptography File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\jwt\algorithms.py”, line 12, in from .utils import ( File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\jwt\utils.py”, line 7, in from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\cryptography\hazmat\primitives\asymmetric\ec.py”, line 11, in from cryptography.hazmat._oid import ObjectIdentifier File “c:\users\muhammedmuzzammil\desktop\again\venv\lib\site-packages\cryptography\hazmat_oid.py”, line 7, in from cryptography.hazmat.bindings._rust import ( ImportError: DLL load failed while importing _rust: The specified procedure could not be found.

Version details-

Rasa Version : 3.6.16 Minimum Compatible Version: 3.5.0 Rasa SDK Version : 3.6.2 Python Version : 3.9.0 Operating System : Windows-10-10.0.22621-SP0 Python Path : c:\users\muhammedmuzzammil\desktop\again\venv\scripts\python.exe

Update: I’ve found the solution to this problem!

The issue was in the cryptography package and after looking at the latest release notes, I’ve noticed that the cryptography version needs to be updated. So, if your current version is 41.0.2 => Please upgrade it to 41.0.7 (This is the latest version currently)

Hope this helps others if they encounter this issue :slight_smile: