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

DLL not found #6

Closed
hartytp opened this issue Apr 12, 2020 · 1 comment · Fixed by #7
Closed

DLL not found #6

hartytp opened this issue Apr 12, 2020 · 1 comment · Fixed by #7

Comments

@hartytp
Copy link
Contributor

hartytp commented Apr 12, 2020

After installing on windows 10 with python 3.7.6 I was getting

    from py3nj import _wigner
ImportError: DLL load failed: The specified module could not be found.

After a bit of digging, it looks like python isn't picking up the DLL located in .libs. I haven't dug too much into the exact source of the issue but, from a quick skim, it looks somewhat like scipy/scipy#11062

Adding the following to my __init__.py resolves the issue

import os
import sys
extra_dll_dir = os.path.join(os.path.dirname(__file__), '.libs')

if sys.platform == 'win32' and os.path.isdir(extra_dll_dir):
    os.environ.setdefault('PATH', '')
    os.environ['PATH'] += os.pathsep + extra_dll_dir

Happy to submit a PR if it helps?

hartytp added a commit to hartytp/py3nj that referenced this issue Apr 12, 2020
@fujiisoup
Copy link
Owner

Thanks, @hartytp

A PR is absolutely welcome.
I have not checked with Windows, as I have no windows...

fujiisoup pushed a commit that referenced this issue Apr 12, 2020
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 a pull request may close this issue.

2 participants