Skip to content

distutils.misc_util.get_info("npymath") returns double backslashes in path when venv is on a network share #18360

@syagev

Description

@syagev

If numpy is installed in a venv which is hosted on a network share on Windows, it seems distutils.misc_util.get_info returns the path with double-backslashes as a path separator. This breaks modules that depend on this output in order to set include and lib paths during compilation (e.g. hmmlearn).

Reproducing code example:

from numpy.distutils.misc_util import get_info
print(get_info("npymath"))

>>> {'include_dirs': ['\\\\\\\\ilabs-htcfs\\\\Shared\\\\styagev\\\\.virtualenvs\\\\OfflineSystem-B.38\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\include'], 'library_dirs': ['\\\\\\\\ilabs-htcfs\\\\Shared\\\\styagev\\\\.virtualenvs\\\\OfflineSystem-B.38\\\\lib\\\\site-packages\\\\numpy\\\\core\\\\lib'], 'libraries': ['npymath'], 'define_macros': []}

The correct path for the npymath library is \\ilabs-htcfs\Shared\styagev\.virtualenvs\OfflineSystem-B.38\lib\site-packages\numpy\core\lib

NumPy/Python version information:

1.20.0 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:57:54) [MSC v.1924 64 bit (AMD64)]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions