Skip to content
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

FileNotFoundError: Could not find module 'v6_w32_nd2ReadSDK.dll'. Try using the full path with constructor syntax. #22

Open
WaterKnight1998 opened this issue Sep 8, 2020 · 4 comments

Comments

@WaterKnight1998
Copy link

This package is not working properly in Windows @soft-matter @aaristov . Even after your version 1.1.

  from nd2reader import ND2Reader
  File "c:\program files\python38\lib\site-packages\nd2reader\__init__.py", line 2, in <module>
    from nd2reader.reader import ND2Reader
  File "c:\program files\python38\lib\site-packages\nd2reader\reader.py", line 1, in <module>
    from pims import Frame
  File "c:\program files\python38\lib\site-packages\pims\__init__.py", line 1, in <module>
    from pims.api import *
  File "c:\program files\python38\lib\site-packages\pims\api.py", line 113, in <module>
    from pims_nd2 import ND2_Reader as ND2Reader_SDK
  File "C:\Users\david\AppData\Roaming\Python\Python38\site-packages\pims_nd2\__init__.py", line 1, in <module>
    from .nd2reader import ND2_Reader
  File "C:\Users\david\AppData\Roaming\Python\Python38\site-packages\pims_nd2\nd2reader.py", line 8, in <module>
    from . import ND2SDK as h
  File "C:\Users\david\AppData\Roaming\Python\Python38\site-packages\pims_nd2\ND2SDK.py", line 23, in <module>
    nd2 = cdll.LoadLibrary('v6_w32_nd2ReadSDK.dll')
  File "c:\program files\python38\lib\ctypes\__init__.py", line 447, in LoadLibrary
    return self._dlltype(name)
  File "c:\program files\python38\lib\ctypes\__init__.py", line 369, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'v6_w32_nd2ReadSDK.dll'. Try using the full path with constructor syntax.

@aaristov
Copy link
Contributor

aaristov commented Sep 9, 2020

I just made a quick test in Miniconda on Windows 10 with pims_nd2 1.1 and python -c "import pims_nd2" works without problems. Please provide us with more details about your system configuration. Which Windows version you use, which python distribution, etc.

@joaomamede
Copy link

+1 on this. Mine also does this in a anaconda environment when pims is half broken. I recommend removing and installing pims.

@diazxraf
Copy link

Hi, I am getting the following error. Please help me to solve it. I am super new to the Python.

File "", line 1, in

File "e:\Example1.py", line 65, in main

server = windll.LoadLibrary("C:/IMPL/IMPLserver.dll")

File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\ctypes_init_.py", line 452, in LoadLibrary

return self._dlltype(name)

File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\ctypes_init_.py", line 374, in init

self._handle = _dlopen(self._name, mode)

FileNotFoundError: Could not find module 'C:\IMPL\IMPLserver.dll' (or one of its dependencies). Try using the full path with constructor syntax.

@xxraytz
Copy link

xxraytz commented Jul 14, 2021

I found the answer. There is a problem with python versions. If you use python >= 3.8 then you should do the following:

Before that:

server = windll.LoadLibrary("C:/IMPL/IMPLserver.dll")

you should write all paths of dll-dependencies by function os.add_dll_directory() like this:

os.add_dll_directory("Path to dll-dependencies for your dll library").

For example I have a library Library.dll which I downloading by windll.LoadLibrary(). And I have dependency "sublibrary.dll" that used in Library.dll and locate in "C://libs". So, I should call the following before windll.LoadLibrary():

import os
os.add_dll_directory(C://libs)

This is the answer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants