Skip to content

BUG: using numpy code that has been deprecated in v1.26.0 #441

Closed
@jpreszler

Description

@jpreszler

Describe the issue:

Numpy v1.26.0 was released on Sept. 16, 2023. It no longer has a get_info() method inside numpy.config which is used https://github.com/pymc-devs/pytensor/blob/main/pytensor/link/c/cmodule.py#L2720. This causes package import to fail because pytensor doesn't have a upper limit on the version of numpy that can be loaded.

Reproducable code example:

# with numpy 1.26.0
import pytensor

Error message:

import pytensor
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/__init__.py:119: in <module>
    from pytensor import scalar, tensor
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/tensor/__init__.py:106: in <module>
    from pytensor.tensor import (  # noqa
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/tensor/blas.py:102: in <module>
    from pytensor.tensor.blas_headers import blas_header_text, blas_header_version
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/tensor/blas_headers.py:1015: in <module>
    if not config.blas__ldflags:
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/configparser.py:321: in __get__
    val_str = self.default()
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/pytensor/link/c/cmodule.py:2720: in default_blas_ldflags
    blas_info = np.__config__.get_info("blas_opt")
E   AttributeError: module 'numpy.__config__' has no attribute 'get_info'
Error: Process completed with exit code 4.

PyTensor version information:

pytensor v2.16.1

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrelease

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions