python 3.6
cryptography 2.0.3
cffi 1.10.0
setuptools 36.5.0.post20170921
cryptography installed on windows with Anaconda package manager.
I am using paramiko to connect via SSH to a local compute cluster.. Connection fails with the error below. I've since reproduced this error using the introductory 'Fernet' example on the pypi cryptography homepage.
from cryptography.hazmat.bindings._openssl import ffi,lib
ImportError: DLL load failed: The operating system cannot run %1
From reading similar error messages online, my google-guess is that the error is due to the package finding incorrect DLLs (in my case, found in C:Program Files (x86)InteliCLS Client). However I do not have any idea on how to rectify, short of prepending PATH with the right location - but what is the right location?
Unfortunately, to investigate we need a way to reproduce this in a fresh environment. However, if you can, could you try installing via pip 9 (the latest pip) without the anaconda package manager? Does the anaconda package manager provide its own prebuilt binaries for this or utilize the wheels we upload to PyPI?
CC @msarahan @mingwandroid
Can you run the script via python to see which DLL is failing? If that doesn't help please use procmon to determine this.
Also conda list --show-channel-urls would be helpful.
Since this is Anaconda related you may want to open an issue at https://github.com/ContinuumIO/anaconda-issues instead of here.
The incriminating DLL was libeay32.dll, found in "C:Program Files (x86)InteliCLS Client". I put in a workaround, essentially by kicking this folder further down my PATH, and so far, it's worked, and nothing else has broken AFAIK. No idea if it's related in some way to this announcement other than mentioning the same DLL.
I can only assume you do not use the Anaconda Prompt or otherwise activate your shell correctly and instead elected for the Anaconda installer to modify your PATH? This is the worst way to use Anaconda, particularly on Windows with it's very poor shared library handling capabilities (DLL hell).
In particular Windows has two PATH parts, system and user. System comes first. The Anaconda installer usually installs as user so adding to PATH here means it's not at the front. Using correct activation, the Anaconda Prompt or Anaconda Navigator avoids all this trouble.
I don't know what this iCLS Client is but do you need it on PATH? When I install stuff on Windows I try to avoid allowing anything to modify PATH.
Steve Dower's announcement is unrelated to this.
I cannot do much with any preinstalled software, this is a work PC with very tight restrictions (I had to put in a request just to get terminal access). You're right, I don't use the anaconda prompt, it is through a launched Spyder IDE instance that I first came across this (Spyder launched directly from the executable, not through Anaconda Navigator). I had been using Anaconda for some time prior to the new recommendations with respect to modifying PATH etc, so I elected to 'stick to what you know'. Thanks for setting me straight! You've convinced me that this is more an issue with my configuration than anything else, so I'm happy to close.
hello
me too i meet this problem under windows 10 , after many search on many websites . i found this solution :
download this : https://github.com/python/cpython-bin-deps/tree/openssl-bin-1.0.2k
zip the file and copy the folder (amd or win ) in your sys path : C:WindowsSysWOW64
and voila every thing works fine
i'm
I'm having this same problem for windows 10 64-bit, namely by trying to use sshtunnel, psycopg2, or pymysql. For the connectors, I get the following error just by importing, while I get it for sshtunnel when trying to start an ssh server:
C:\Anaconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py in <module>()
....long traceback....
---> 13 from cryptography.hazmat.bindings._openssl import ffi, lib
.....
ImportError: DLL load failed: The operating system cannot run %1.
I've tried putting anaconda to the front of my path variable and I've tried removing it from path and using the anaconda prompt, but it has not solved the problem. Kind of at my wit's end trying to figure this out, any suggestions? (I did not install anaconda with the option to append to path selected, i added later to path myself to have cmd access to python.exe and jupyter.exe).
I had same error while running scrapy from anaconda prompt. By seeing on process monitor, it caused by both dll files cannot be found inside Anaconda3Libsite-packagescryptographyhazmatbindings.
Copy both files from Anaconda3pkgsopenssl-1.0.2o-h8ea7d77_0Librarybin into Anaconda3Libsite-packagescryptographyhazmatbindings, and it works
make an anaconda environment and run the script to install again
@ajay-banstola I tried that to no effect. @adithcraft I tried that, also to no effect.
After a long search i found the solution
The problem is that if the GPU is old the pytorch version before 0.4.0 doesn鈥檛 work, so you have to install the newest pytorch,
run this - conda install -c pytorch pytorch
After you install the newest pytorch you will face torch._C import * DLL load failed problem
to fix that run the ff code
set PYTORCH_BUILD_VERSION=0.4.1
conda install -c pytorch pytorch
set PYTORCH_BUILD_VERSION=0.4.1
conda update --all resolved this for me.
Most helpful comment
I had same error while running scrapy from anaconda prompt. By seeing on process monitor, it caused by both dll files cannot be found inside Anaconda3Libsite-packagescryptographyhazmatbindings.
Copy both files from Anaconda3pkgsopenssl-1.0.2o-h8ea7d77_0Librarybin into Anaconda3Libsite-packagescryptographyhazmatbindings, and it works