Skip to content

BUG: Can't parse version in threadpoolctl #131

@larsoner

Description

@larsoner

Over in MNE-Python we install threadpoolctl via conda-forge and do theadpool_info(), and on a Windows Python 3.9 build we just recently started getting:

Traceback (most recent call last):
  File "C:\Miniconda\Scripts\mne-script.py", line 33, in <module>
    sys.exit(load_entry_point('mne', 'console_scripts', 'mne')())
  File "d:\a\1\s\mne\commands\utils.py", line 107, in main
    cmd.run()
  File "d:\a\1\s\mne\commands\mne_sys_info.py", line 32, in run
    mne.sys_info(show_paths=options.show_paths, dependencies=dependencies)
  File "d:\a\1\s\mne\utils\config.py", line 574, in sys_info
    libs = _get_numpy_libs()
  File "d:\a\1\s\mne\utils\config.py", line 457, in _get_numpy_libs
    pools = threadpool_info()
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 124, in threadpool_info
    return _ThreadpoolInfo(user_api=_ALL_USER_APIS).todicts()
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 340, in __init__
    self._load_modules()
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 373, in _load_modules
    self._find_modules_with_enum_process_module_ex()
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 485, in _find_modules_with_enum_process_module_ex
    self._make_module_from_path(filepath)
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 515, in _make_module_from_path
    module = module_class(filepath, prefix, user_api, internal_api)
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 606, in __init__
    self.version = self.get_version()
  File "C:\Miniconda\lib\site-packages\threadpoolctl.py", line 646, in get_version
    config = get_config().split()
AttributeError: 'NoneType' object has no attribute 'split'

See https://dev.azure.com/mne-tools/mne-python/_build/results?buildId=22184&view=logs&jobId=0c05fc83-a48b-5f98-b273-c45838b34ec6&j=0c05fc83-a48b-5f98-b273-c45838b34ec6&t=255738a5-d0e6-59ca-8928-77e8bceb6658.

This is a bit mysterious to me since the threadpoolctl on conda-forge is ~7 months old. Any ideas how this get_config() could return None, and if so, how it could be worked around to not raise an error here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions