gpt4 book ai didi

python - 导入错误:DLL failed when using scrapy in command prompt

转载 作者:行者123 更新时间:2023-11-30 22:26:40 24 4
gpt4 key购买 nike

尝试使用 scrapy 命令创建文件夹时遇到以下问题。我尝试搜索这个问题并在 https://groups.google.com/forum/#!topic/scrapy-users/8N6V_OGUqtI 找到了解决方案我尝试了那里提供的步骤,但仍然遇到这个问题。

任何解决此问题的帮助将不胜感激。

(C:\Users\dell\Anaconda3) C:\Users\dell>activate scrapy-env

(scrapy-env) C:\Users\dell>scrapy startproject tutorial
Traceback (most recent call last):
File "C:\Users\dell\Anaconda3\envs\scrapy-env\Scripts\scrapy-script.py", line 5, in <module>
sys.exit(scrapy.cmdline.execute())
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\cmdline.py", line 128, in execute
cmds = _get_commands_dict(settings, inproject)
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\cmdline.py", line 46, in _get_commands_dict
cmds = _get_commands_from_module('scrapy.commands', inproject)
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\cmdline.py", line 29, in _get_commands_from_module
for cmd in _iter_command_classes(module):
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\cmdline.py", line 19, in _iter_command_classes
for module in walk_modules(module_name):
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\utils\misc.py", line 71, in walk_modules
submod = import_module(fullpath)
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\scrapy\commands\version.py", line 6, in <module>
import OpenSSL
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\OpenSSL\rand.py", line 10, in <module>
from OpenSSL._util import (
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "C:\Users\dell\Anaconda3\envs\scrapy-env\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The operating system cannot run %1.

最佳答案

以防万一其他人最终来到这里,这对我有用:我在从 anaconda 提示符运行 scrapy 时遇到了同样的错误。通过进程监视器查看,是由于Anaconda3\Lib\site-packages\cryptography\hazmat\bindings中找不到这两个dll文件造成的。将两个文件从 Anaconda3\pkgs\openssl-1.0.2o-h8ea7d77_0\Library\bin 复制到 Anaconda3\Lib\site-packages\cryptography\hazmat\bindings 中,它可以工作

关于python - 导入错误:DLL failed when using scrapy in command prompt,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47164238/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com