Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

Image 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.

Image 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.

like image 882
user7073995 Avatar asked Jan 26 '26 17:01

user7073995


2 Answers

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.

like image 98
R. Max Avatar answered Jan 29 '26 07:01

R. Max


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.

like image 27
ZF007 Avatar answered Jan 29 '26 09:01

ZF007