|
18 | 18 | if sys.platform.startswith('win'): |
19 | 19 | # This only works for Anaconda / miniconda |
20 | 20 | # On other systems, logic needs to be added here. |
| 21 | + # there must be a better way to do this -- why doesn't conda take care of it? |
21 | 22 | libpath = os.path.join(os.path.split(sys.executable)[0], "Library", "bin") |
22 | 23 |
|
23 | | - # UGLY kludge for Windows: load the libgd dll with ctypes so it can be used by the extension |
24 | | - # import ctypes |
25 | | - # # note: need to load up the dependencies, too |
26 | | - # # this is a serious kludge! |
27 | | - # try: |
28 | | - # libpng = ctypes.cdll.LoadLibrary(os.path.join(libpath,'libpng16.dll')) |
29 | | - # zlib = ctypes.cdll.LoadLibrary(os.path.join(libpath,'zlib.dll')) |
30 | | - # libgd = ctypes.cdll.LoadLibrary(os.path.join(libpath,'libgd.dll')) |
31 | | - # except WindowsError as err: |
32 | | - # raise WindowsError("Can't find dlls for libgd, libpng, and libz.\n" |
33 | | - # "This kludge is only written to support Anaconda installs") |
34 | | - |
35 | | - # alternative ugly kludge: add lib dir to PATH: |
| 24 | + # Add lib dir to PATH: |
36 | 25 | if (os.path.isfile(os.path.join(libpath, 'libpng16.dll')) and |
37 | 26 | os.path.isfile(os.path.join(libpath, 'zlib.dll')) and |
38 | 27 | os.path.isfile(os.path.join(libpath, 'libgd.dll'))): |
39 | 28 | os.environ['PATH'] = libpath + os.pathsep + os.environ['PATH'] |
40 | 29 |
|
41 | | - # raise RuntimeError("Can't find dlls for libgd, libpng, and libz.\n" |
42 | | - # "This kludge is only written to support Anaconda installs\n", |
43 | | - # "you may need to add some logic for other library locations", |
44 | | - # ) |
45 | 30 | try: |
46 | 31 | from .py_gd import * # noqa: F401 |
47 | 32 |
|
|
0 commit comments