__init__.py
Go to the documentation of this file.
1 #
2 # Copyright (c) 2017-2021 CNRS INRIA
3 #
4 
5 # On Windows, if eigenpy.dll is not in the same directory than
6 # the .pyd, it will not be loaded.
7 # We first try to load eigenpy, then, if it fail and we are on Windows:
8 # 1. We add all paths inside eigenpy_WINDOWS_DLL_PATH to DllDirectory
9 # 2. If EIGENPY_WINDOWS_DLL_PATH we add the relative path from the
10 # package directory to the bin directory to DllDirectory
11 # This solution is inspired from:
12 # - https://github.com/PixarAnimationStudios/OpenUSD/pull/1511/files
13 # - https://stackoverflow.com/questions/65334494/python-c-extension-packaging-dll-along-with-pyd
14 # More resources on https://github.com/diffpy/pyobjcryst/issues/33
15 try:
16  from .eigenpy_pywrap import * # noqa
17  from .eigenpy_pywrap import __raw_version__, __version__
18 except ImportError:
19  import platform
20 
21  if platform.system() == "Windows":
22  from .windows_dll_manager import build_directory_manager, get_dll_paths
23 
24  with build_directory_manager() as dll_dir_manager:
25  for p in get_dll_paths():
26  dll_dir_manager.add_dll_directory(p)
27  from .eigenpy_pywrap import * # noqa
28  from .eigenpy_pywrap import __raw_version__, __version__ # noqa
29  else:
30  raise
eigenpy.windows_dll_manager.build_directory_manager
def build_directory_manager()
Definition: windows_dll_manager.py:61
eigenpy.windows_dll_manager.get_dll_paths
def get_dll_paths()
Definition: windows_dll_manager.py:6


eigenpy
Author(s): Justin Carpentier, Nicolas Mansard
autogenerated on Fri Jun 14 2024 02:15:58