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

Something wrong with the file 'mkl_intel_thread.dll',and I make a new hooks #2946

Closed
LittleWhite-Carry opened this issue Oct 30, 2017 · 1 comment
Labels
area:hooks Caused by or effecting some hook

Comments

@LittleWhite-Carry
Copy link

LittleWhite-Carry commented Oct 30, 2017

I have Python3.5 and Anaconda3. I installed numpy+mkl.whl, but I also have 'mkl_*' files in \Anaconda3\Library\bin.
So everytime I pack my file to .exe, those files of 'mkl_
' have something wrong. So I make a little change of your file 'hook-numpy.core.py'.
I try to upload it, but I can't. Sorry. I mark the part of my change. I hope it can help a lot.

import os
import os.path
import re
from PyInstaller.utils.hooks import get_package_paths
from PyInstaller import log as logging
from PyInstaller import compat

binaries = []

pkg_base, pkg_dir = get_package_paths('numpy.core')
re_anylib = re.compile(r'\w+\.(?:dll|so|dylib)', re.IGNORECASE)
dlls_pkg = [f for f in os.listdir(pkg_dir) if re_anylib.match(f)]
binaries += [(os.path.join(pkg_dir, f), '') for f in dlls_pkg]

if compat.is_win:
    if os.path.exists(os.path.join(compat.base_prefix, 'Lib\\site-packages\\numpy\core')):   ###Here is the change
        lib_dir = os.path.join(compat.base_prefix, 'Lib\\site-packages\\numpy\core')         ###Here is the change
    else:
        lib_dir = os.path.join(compat.base_prefix, "Library", "bin")
else:
    lib_dir = os.path.join(compat.base_prefix, "lib")
if os.path.isdir(lib_dir):
    re_mkllib = re.compile(r'^(?:lib)?mkl\w+\.(?:dll|so|dylib)', re.IGNORECASE)
    dlls_mkl = [f for f in os.listdir(lib_dir) if re_mkllib.match(f)]
    if dlls_mkl:
        logger = logging.getLogger(__name__)
        logger.info("MKL libraries found when importing numpy. Adding MKL to binaries")
        binaries += [(os.path.join(lib_dir, f), '') for f in dlls_mkl]
@htgoebel
Copy link
Member

Thanks for the updated hook. You promised to mark the change, but I can not spot it.

@htgoebel htgoebel added the area:hooks Caused by or effecting some hook label Oct 30, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:hooks Caused by or effecting some hook
Projects
None yet
Development

No branches or pull requests

3 participants