New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WindowsError when importing openslide using 64-bit version #23
Comments
Hi @macmatt22, we've received a user report that this error is caused by another copy of one of OpenSlide's dependencies, such as zlib1.dll, in the search path. |
Thanks for your help! Yeah, it turns out that for at least zlib1.dll there were multiple copies installed by other applications. As the user report stated, I was able to fix the problem by starting python inside the openslide/bin directory - this changes the search hierarchy such that the openslide version of zlib1.dll is found first. For the benefit of a future reader, I added the following to lowlevel.py to allow it to work outside of openslide/bin: |
The issue is that the file is named
And OpenSlide finds the wrong DLL
|
I tried to add os.environ['PATH'] = "path-to-openslide-bin" + ";" + os.environ['PATH'], it works perfectly when I use python with Consol, but when I spyder i get the same error as befor can someone help me? |
I have a similar error. I installed openslide-python with pip and added the path to environment variables, but when I try to import openslide, this error occurs: FileNotFoundError: Could not find module 'libopenslide-0.dll' (or one of its dependencies). Try using the full path with constructor syntax. I have tried to add os.environ['PATH'] = "path-to-openslide-bin" + ";" + os.environ['PATH'] to lowlevel.py and to start Python from the openslide bin, but that doesn't help. I also uninstalled openslide several times and tried with different downloads. Any ideas? |
@LiesMH
|
OS: Windows 10 |
I am facing the same problem while trying to import openslide package. |
@narminGhaffari You are looking at the wrong location. If you go through the installation guide of openslide-python on https://pypi.org/project/openslide-python/ . You first have to Install Openslide. For windows, that means extracting the binaries provided at https://openslide.org/download/. In that folder you will find the /bin/ folder which you have to provide in the PATH variable in environment variables. I hope it solves your issue. |
@jalilahmed thank you alot for the respond. I downloaded the openslide and added this line to the enviroment path and also as every body recomended I added this line os.environ['PATH'] = r"C:\openslide-win64-20171122\openslide-win64-20171122\bin" + ";" + os.environ['PATH'] to the lowlevel.py file. but unfortunatly I am still receieving the winError 126. I sthere any thing else which I have to do? |
Thank you, this worked perfectly! |
i meet the same error , are you find the solution? |
This is how I solved the issue Finally : ` if platform.system() == 'Windows': |
Thanks for your answer ! After i modify the lowlevel.py as your solution ,but my spyder still can't import openslide because of OSError: [WinError 127] . I think maybe there is something wrong in my system that i can't find. |
Did you download the openslide bin to your system? |
Yes. I download the openslide bin in D:\openslide-win64-20171122\bin, add environment path to system and also modify the lowlevel.py . In the end , i can import openslide in cmd normally ,but the spyder can't work. |
Is there someone encounter the bug--(AttributeError: module 'os' has no attribute 'add_dll_directory') , when solve OSError: [WinError 127] in lowlevel.py . I need help for this problem ,why this happen and how to solve it. |
|
Hi.
Would anyone be able to help me in this matter please. Thanks & Best Regards Michael |
See the OpenSlide Python installation instructions for the currently recommended way to point OpenSlide Python to the OpenSlide DLL on Windows. It shouldn't be necessary to modify the OpenSlide Python source code. The |
Context
Issue type (bug report perhaps?):
Operating system (Windows 10):
Platform (64-bit):
OpenSlide version (2016-7-17 64 bit release):
Slide format (NA):
Details
I installed the OpenSlide binaries and added the bin folder to my system path. I then installed python-openslide using pip. I tried same workflow with Python 3.5.3 and encountered the same problem. Interestingly, when I tested this with the 32-bit version of Python(2.7)/OpenSlide I did not have this issue. However, I have a 64-bit machine and would prefer to use the 64-bit versions.
Not sure if this is a bug or is specific to my configuration. Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: