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

Fix dll not found error #18

Merged
merged 4 commits into from
Jun 21, 2020
Merged

Fix dll not found error #18

merged 4 commits into from
Jun 21, 2020

Conversation

aaristov
Copy link
Contributor

While importing pims_nd2 in python 3.8, I get the following error:

c:\users\aaristov\appdata\local\programs\python\python38-32\lib\site-packages\pims_nd2\nd2reader.py in
6 from pims.base_frames import FramesSequenceND
7 import os
----> 8 from . import ND2SDK as h
9 from ctypes import c_uint8, c_uint16, c_float
10

c:\users\aaristov\appdata\local\programs\python\python38-32\lib\site-packages\pims_nd2\ND2SDK.py in
21 raise OSError("The bitsize does not equal 32 or 64.")
22 os.environ["PATH"] += os.pathsep + os.path.join(dlldir)
---> 23 nd2 = cdll.LoadLibrary('v6_w32_nd2ReadSDK.dll')
24
25

c:\users\aaristov\appdata\local\programs\python\python38-32\lib\ctypes_init_.py in LoadLibrary(self, name)
449
450 def LoadLibrary(self, name):
--> 451 return self._dlltype(name)
452
453 cdll = LibraryLoader(CDLL)

c:\users\aaristov\appdata\local\programs\python\python38-32\lib\ctypes_init_.py in init(self, name, mode, handle, use_errno, use_last_error, winmode)
371
372 if handle is None:
--> 373 self._handle = _dlopen(self._name, mode)
374 else:
375 self._handle = handle

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

Adding the absolute path fixes the problem.

@rbnvrw
Copy link

rbnvrw commented Apr 26, 2020

Hi @aaristov thank you for taking the time to fix this! Is there a reason why you changed the version to 1.0-dev? If not, could you please change it back? Then I'll merge the PR.

@jonathan-kuo11
Copy link

Hi--completely new to Github here, but I just installed pims_nd2 and I ran into the same problem. Just wanted to put it out here that I had to input the full path to v6_w32_nd2ReadSDK.dll into ND2SDK.py to fix it, which seems to be a manual version of what @aaristov has done automatically. How do I get the changes that @aaristov has written?

@aaristov
Copy link
Contributor Author

pip install git+https://github.com/aaristov/pims_nd2.git

In setup.py you can use the following trick to override default pip requirement:

setup(
    install_requires=[
          "pims_nd2 @ git+https://github.com/aaristov/pims_nd2.git",
    ]

BTW, I'm looking forward to the pull request to be finally merged. It's already long validated and just pending a click.

@caspervdw caspervdw merged commit c25a847 into soft-matter:master Jun 21, 2020
@caspervdw
Copy link
Member

caspervdw commented Jun 21, 2020

Thanks @aaristov . Done and distributed a new release.

@WaterKnight1998
Copy link

The version 1.1 and merge didn't solve the error: #21

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

Successfully merging this pull request may close these issues.

6 participants