You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Windows] Cannot import _pywrap_tensorflow when zlib.dll is not in PATH #5275
That's great that you do!
But i don't have Nvidia, sorry :P
Oh, and I focused so much on that form that I forgot to write what's wrong xD
But that seems evident from the logs. It installs correctly (no cmake errors) but builds with warnings. I have the wheel and folder with setup.py. Both give the same error on import.
Oh, I see. Well, you have to debug why it's not loading. There are usually two reasons for that, and python would typically give the same error message:
The _pywrap_tensorflow.dll is not found in the path. You have to fiddle with the system paths. There are lots of hits on the web to figure that out
the dll itself does not resolve some transitive dependencies (e.g. it cannot find libcudart). You can download the dependency walker for that
I copied the dll and libs and other stuff to Python folders already, with no success. But I tried the dependency walker, and here's what I found:
All API-MS-.dll are missing
All EXT-MS-.dll are missing
also DEVICECLOCKHELPERS.DLL, EMCLIENT.DLL, ZLIB.DLL are missing
try getting zlib1 or zlib in place. The dirtiest, but easiest, is probably to put in in C:\windows\system. If you poke around the installation directory these DLLs should be there.
I'll check with that msvc crt later today.
I understand that there are out-of-the-box implementations of python for data science, but unfortunately I cannot use it in the project.
The truth is that I switched to sklearn since time is of the essence here, but if I'm able to solve that in my free time I might devise some sort of tutorial on how to solve problems that I've encountered.
@drpngx Oh and about that script, you told me to run something with a shell again, but do you mean simply to run python and try to import again, or try to build/install again?
I ran into this problem too after pip installing the cmake-built .whl (this is on vanilla Python 3.5 64-bit and built with VS2015). Although dependency walker suggested a bunch of missing dlls, the only one it actually needed was zlib.dll; after copying that from the build directory into the package installation directory under site-packages, the import worked just fine. I realize this is something that @KamodaP already tried unsuccessfully, but I thought it'd be worth chiming in anyway.
To that effect, should zlib.dll be vendored inside the wheel by cmake, or can it be listed as a dependency?
I haven't done one thing yet that I think I might try. Because I've copied the dll to DLLs in Python (C:\[...]\Python35\DLLs) directory, perhaps that's not the right thing to do and I should put it in C:\Windows directory?
@KamodaP No, just a random directory that was in my PATH. I'm not yet sure where to give a permanent place, so I checked by adding custom directory with zlib.dll to my PATH and it solved the importing issue.
Hi folks, thanks for digging into this! It looks like we end up depending on both the static and dynamic versions of zlib on Windows, for some reason... I'm guessing it's one of the external project on which we depend, maybe libpng?
I'm going to rename the bug and I'll look into removing this dependency on zlib.dll.
changed the title [-]Tensorflow build myself on windows 10 cannot import _pywrap_tensorflow[/-][+][Windows] Cannot import _pywrap_tensorflow when zlib.dll is not in PATH[/+]on Nov 4, 2016
So it does work after putting zlib.dll into a directory that is referenced in PATH environment variable, but it DOES NOT work when put in directory that is in PYTHONPATH (or something like that) so including DLLs directory.
In win10 x64 cmake error
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - found
-- Found Threads: TRUE
this is the only error appeared during cmake ,is it very important for the msbuild?
or i can just ignore it.
With ignore it ,i msbuild the project ,but stuck during clone protobuf and jsoncpp ,is it related the missing of pthreads.lib?
i have successfully install the pthread protobuf and jsoncpp by testing in vs2015, so i don' t think the issue comes from installing .
In vs2015 i use prgma linking to the pthreads.lib where can i add prgma in cmake files ,i haven;t find the target file, so i add prgma to every (5) file including pthread.h ,how can i fix this problem .
Activity
drpngx commentedon Oct 29, 2016
We now have windows GPU support with cmake. It should work with cuda 6.5.
KamodaP commentedon Oct 29, 2016
That's great that you do!
But i don't have Nvidia, sorry :P
Oh, and I focused so much on that form that I forgot to write what's wrong xD
But that seems evident from the logs. It installs correctly (no cmake errors) but builds with warnings. I have the wheel and folder with setup.py. Both give the same error on import.
drpngx commentedon Oct 29, 2016
Oh, I see. Well, you have to debug why it's not loading. There are usually two reasons for that, and python would typically give the same error message:
KamodaP commentedon Oct 29, 2016
I copied the dll and libs and other stuff to Python folders already, with no success. But I tried the dependency walker, and here's what I found:
All API-MS-.dll are missing
All EXT-MS-.dll are missing
also DEVICECLOCKHELPERS.DLL, EMCLIENT.DLL, ZLIB.DLL are missing
drpngx commentedon Oct 29, 2016
try getting zlib1 or zlib in place. The dirtiest, but easiest, is probably to put in in
C:\windows\system. If you poke around the installation directory these DLLs should be there.KamodaP commentedon Oct 30, 2016
I copied this zlib.dll to some places, but nothing changed. And I couldn't find those previous two (or any of those prefixed with *-MS-[...])
drpngx commentedon Oct 30, 2016
Can you give the full names?
KamodaP commentedon Oct 31, 2016
Here you go: dll_names.txt
aselle commentedon Nov 1, 2016
@mrry, do you have any further insight?. I have no way to test this. You might try adding the DLL directories to PYTHONPATH and your windows PATH.
2 remaining items
KamodaP commentedon Nov 2, 2016
I'll check with that msvc crt later today.
I understand that there are out-of-the-box implementations of python for data science, but unfortunately I cannot use it in the project.
The truth is that I switched to sklearn since time is of the essence here, but if I'm able to solve that in my free time I might devise some sort of tutorial on how to solve problems that I've encountered.
@drpngx Oh and about that script, you told me to run something with a shell again, but do you mean simply to run python and try to import again, or try to build/install again?
reiv commentedon Nov 2, 2016
I ran into this problem too after
pip installing the cmake-built.whl(this is on vanilla Python 3.5 64-bit and built with VS2015). Although dependency walker suggested a bunch of missing dlls, the only one it actually needed waszlib.dll; after copying that from thebuilddirectory into the package installation directory undersite-packages, the import worked just fine. I realize this is something that @KamodaP already tried unsuccessfully, but I thought it'd be worth chiming in anyway.To that effect, should
zlib.dllbe vendored inside the wheel by cmake, or can it be listed as a dependency?KamodaP commentedon Nov 3, 2016
I haven't done one thing yet that I think I might try. Because I've copied the dll to DLLs in Python (
C:\[...]\Python35\DLLs) directory, perhaps that's not the right thing to do and I should put it inC:\Windowsdirectory?zandaqo commentedon Nov 3, 2016
@reiv Same story here, same mistake and copying
zlib.dllhelped, thanks for the suggestion. I too think the wheel could address this issue better.KamodaP commentedon Nov 3, 2016
@zandaqo did you copy it to windows directory?
zandaqo commentedon Nov 3, 2016
@KamodaP No, just a random directory that was in my
PATH. I'm not yet sure where to give a permanent place, so I checked by adding custom directory withzlib.dllto myPATHand it solved the importing issue.mrry commentedon Nov 4, 2016
Hi folks, thanks for digging into this! It looks like we end up depending on both the static and dynamic versions of
zlibon Windows, for some reason... I'm guessing it's one of the external project on which we depend, maybe libpng?I'm going to rename the bug and I'll look into removing this dependency on
zlib.dll.[-]Tensorflow build myself on windows 10 cannot import _pywrap_tensorflow[/-][+][Windows] Cannot import _pywrap_tensorflow when zlib.dll is not in PATH[/+]KamodaP commentedon Nov 4, 2016
So it does work after putting zlib.dll into a directory that is referenced in PATH environment variable, but it DOES NOT work when put in directory that is in PYTHONPATH (or something like that) so including DLLs directory.
[Windows/CMake] Remove dependency on zlib.dll.
[Windows/CMake] Remove dependency on zlib.dll. (#5456)
lidongyv commentedon Nov 13, 2016
In win10 x64 cmake error
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - found
-- Found Threads: TRUE
this is the only error appeared during cmake ,is it very important for the msbuild?
or i can just ignore it.
With ignore it ,i msbuild the project ,but stuck during clone protobuf and jsoncpp ,is it related the missing of pthreads.lib?
i have successfully install the pthread protobuf and jsoncpp by testing in vs2015, so i don' t think the issue comes from installing .
In vs2015 i use prgma linking to the pthreads.lib where can i add prgma in cmake files ,i haven;t find the target file, so i add prgma to every (5) file including pthread.h ,how can i fix this problem .
Update from original Nov 14 (#1)