简体   繁体   中英

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.

I run scrapy command: scrapy startproject tutorial in MS-DOS window then get the following error message:

图片1

I am sure i have installed scrapy, but any scrapy command is not working.

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.

图2

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.

Try using the conda-forge channel which contains up to date packages.

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.

name = scrapy or cryptography

Just pip uninstall "name" as its likely for conda to tell you some of the uninstall cannot be done due to dependencies.

Thereafter 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. it also said that built a WIN32 version is better, but i didn't try. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM