Skip to content

cannot import name 'cache' from 'functools' on Python 3.8 #186

Description

@njzjz
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/array_api_compat/common/_helpers.py:516: in array_namespace
    from .. import torch as torch_namespace
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/array_api_compat/torch/__init__.py:15: in <module>
    from ._aliases import * # noqa: F403
/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/array_api_compat/torch/_aliases.py:14: in <module>
    from ._info import __array_namespace_info__
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    """
    Array API Inspection namespace
    
    This is the namespace for inspection functions as defined by the array API
    standard. See
    https://data-apis.org/array-api/latest/API_specification/inspection.html for
    more details.
    
    """
    import torch
    
>   from functools import cache
E   ImportError: cannot import name 'cache' from 'functools' (/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/functools.py)

cache was added in Python 3.9.

I don't find the minimal Python version supported by array-api-compat, but if there is, it's better to add python_requires to the metadata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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