Skip to content

distutils/misc_util.py Configuration settings lead to ImportError DLL load failed #14923

@ilayn

Description

@ilayn

When building NumPy from the source on Windows 10, the resulting .libs folder is not added to the path.

Reproducing code example:

The regular

python setup.py build
python setup.py install

machinery succeeds however afterwards numpy import fails with the recently reported ImportErrors elsewhere, say, #14896 and others.

This happens also on SciPy builds which were successfully working until I switched to Python 3.8. This is also reported on SciPy scipy/scipy#11062

It seems like the generated __config__.py has the lines

# For gfortran+msvc combination, extra shared libraries may exist
f.write(textwrap.dedent("""
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
"""))

Somehow, .libs folder is not present on the src.win-amd64-3.8 but it is created in lib.win-amd64-3.8 and for reasons I have not yet understood, this if branch is not entered. On the linked SciPy issue, the file is modified manually to add the libs to the path.

Hence I am under the impression that it is not necessarily an Anaconda issue but something has changed along the way, that is maybe, Python3.8 related.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions