[英]ImportError: DLL load failed: The operating system cannot run %1. Python 2.7.12 |Anaconda 4.2.0 (64-bit)
My Operating System is Win10-x64. 我的操作系统是Win10-x64。
I run scrapy command: scrapy startproject tutorial
in MS-DOS window then get the following error message: 我在MS-DOS窗口中运行scrapy命令:
scrapy startproject tutorial
然后得到以下错误消息:
I am sure i have installed scrapy, but any scrapy command is not working. 我确信我已经安装了scrapy,但是任何scrapy命令都无法正常工作。
I notice the log: " from cryptography.hazmat.bindings._openssl import ffi, lib " and i seach the file cryptography.hazmat.bindings._openssl found it _openssl is a .pyd file. 我注意到日志:“ 来自cryptography.hazmat.bindings._openssl import ffi,lib ”,我发现文件cryptography.hazmat.bindings._openssl发现它_openssl是一个.pyd文件。
it seems there is some error exist in this file. 看来这个文件中存在一些错误。
I also notice that the OpenSSL package in Anaconda was built with vc9, I install the micro runtime environment and it didn't help me. 我还注意到Anaconda中的OpenSSL包是用vc9构建的,我安装了微运行时环境,它对我没有帮助。
Try using the conda-forge
channel which contains up to date packages. 尝试使用包含最新包的
conda-forge
通道。
conda install scrapy -c conda-forge
Note: Use a new environment as it's likely you installed cryptography
(and possibly lxml
) via pip
, and that may not play well with a conda
environments. 注意:使用新环境,因为您可能通过
pip
安装了cryptography
(可能还有lxml
),这可能不适合conda
环境。
name = scrapy or cryptography name = scrapy或cryptography
Just pip uninstall "name"
as its likely for conda to tell you some of the uninstall cannot be done due to dependencies. 只需点击
pip uninstall "name"
因为它可能会让conda告诉你由于依赖性而无法完成某些卸载。
Thereafter pip install "name"
此后
pip install "name"
Problem is likely to be solved by now. 问题很可能现在已经解决了。
I Build OpenSSL WIN64 release version with Visual studio 2015, and replace libeay32.dll and ssleay32.dll to "C:\\Windows\\System32", then scrapy command work. 我使用Visual Studio 2015构建OpenSSL WIN64版本,并将libeay32.dll和ssleay32.dll替换为“C:\\ Windows \\ System32”,然后scrapy命令工作。 it also said that built a WIN32 version is better, but i didn't try.
它还说建立一个WIN32版本更好,但我没试过。 I built dynamic libraries, not static libraries.
我构建了动态库,而不是静态库。 Build Command for anyone interest:
为任何兴趣的人建立命令:
cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
vcvars64.bat
perl Configure VC-WIN64A no-asm --prefix="c:\openssl-1.0.2j\build-vc14-debug-win64-dll"
ms\do_win64a.bat
nmake -f ms\ntdll.mak
nmake -f ms\ntdll.mak test
nmake -f ms\ntdll.mak install
nmake -f ms\ntdll.mak clean
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.