pyca / cryptography

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers.
https://cryptography.io
Other
6.54k stars 1.5k forks source link

ImportError: DLL load failed while importing _rust: The specified procedure could not be found. #11325

Closed byteherder closed 1 month ago

byteherder commented 1 month ago

I am trying to install Scrapy using PyCharm as my IDE. I have followed the install procedure on their website. I am getting the following error.

Traceback (most recent call last): File "C:\Users\chris\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\chris\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\chris\PycharmProjects\WebCrawler\venv\Scripts\scrapy.exe__main.py", line 4, in File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\cmdline.py", line 9, in from scrapy.commands import BaseRunSpiderCommand, ScrapyCommand, ScrapyHelpFormatter File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\commands__init.py", line 11, in from scrapy.crawler import CrawlerProcess File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\crawler.py", line 27, in from scrapy.core.engine import ExecutionEngine File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\core\engine.py", line 28, in from scrapy.core.downloader import Downloader File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\core\downloader\init__.py", line 16, in from scrapy.signalmanager import SignalManager File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\signalmanager.py", line 6, in from scrapy.utils import signal as _signal File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\utils\signal.py", line 20, in from scrapy.utils.log import failure_to_exc_info File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\utils\log.py", line 26, in from scrapy.utils.versions import scrapy_components_versions File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\utils\versions.py", line 13, in from scrapy.utils.ssl import get_openssl_version File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\scrapy\utils\ssl.py", line 3, in import OpenSSL._util as pyOpenSSLutil File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\OpenSSL\init__.py", line 8, in from OpenSSL import SSL, crypto File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\OpenSSL\SSL.py", line 11, in from OpenSSL._util import ( File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\OpenSSL_util.py", line 6, in from cryptography.hazmat.bindings.openssl.binding import Binding File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 15, in from cryptography.exceptions import InternalError File "c:\users\chris\pycharmprojects\webcrawler\venv\lib\site-packages\cryptography\exceptions.py", line 9, in from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions ImportError: DLL load failed while importing _rust: The specified procedure could not be found.

I upgraded OpenSSL to the latest but that did not solve the issue.

alex commented 1 month ago

Are you using windows 7?

byteherder commented 1 month ago

I am using Windows 10.

alex commented 1 month ago

What version of Python 3.9 are you using? Is it 3.9.0 or 3.9.1?

byteherder commented 1 month ago

Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32

alex commented 1 month ago

Please try upgrading to a more recent Python 3.9, 3.9.1 had some issues.

byteherder commented 1 month ago

I'll try that. Thanks.

byteherder commented 1 month ago

I installed Python 3.9.13 and it solved the issue.

Issue solved.

alex commented 1 month ago

Great, glad to hear it.