Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import pyproffit fails for numpy 1.26 #26

Open
jdeplaa opened this issue Mar 14, 2024 · 1 comment
Open

Import pyproffit fails for numpy 1.26 #26

jdeplaa opened this issue Mar 14, 2024 · 1 comment

Comments

@jdeplaa
Copy link

jdeplaa commented Mar 14, 2024

Dear @domeckert,

When I install pyproffit in an environment with numpy version 1.26.4, which is the default these days, I get the following error when the module is imported.

>>> import pyproffit
Traceback (most recent call last):
  File "pytensor/configparser.py", line 201, in fetch_val_for_key
    return self._pytensor_cfg.get(section, option)
  File "lib/python3.10/configparser.py", line 783, in get
    d = self._unify_values(section, vars)
  File "python3.10/configparser.py", line 1154, in _unify_values
    raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'blas'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pytensor/configparser.py", line 317, in __get__
    val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key)
  File "pytensor/configparser.py", line 205, in fetch_val_for_key
    raise KeyError(key)
KeyError: 'blas__ldflags'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/pyproffit/validation/test_script.py", line 1, in <module>
    import pyproffit
  File "pyproffit-0.8-py3.10.egg/pyproffit/__init__.py", line 6, in <module>
  File "pyproffit-0.8-py3.10.egg/pyproffit/models.py", line 2, in <module>
  File "pymc/__init__.py", line 47, in <module>
    __set_compiler_flags()
  File "pymc/__init__.py", line 30, in __set_compiler_flags
    import pytensor
  File "pytensor/__init__.py", line 119, in <module>
    from pytensor import scalar, tensor
  File "pytensor/tensor/__init__.py", line 106, in <module>
    from pytensor.tensor import (  # noqa
  File "pytensor/tensor/blas.py", line 102, in <module>
    from pytensor.tensor.blas_headers import blas_header_text, blas_header_version
  File "pytensor/tensor/blas_headers.py", line 1015, in <module>
    if not config.blas__ldflags:
  File "pytensor/configparser.py", line 321, in __get__
    val_str = self.default()
  File "pytensor/link/c/cmodule.py", line 2720, in default_blas_ldflags
    blas_info = np.__config__.get_info("blas_opt")
AttributeError: module 'numpy.__config__' has no attribute 'get_info'

This issue does not occur when numpy is downgraded to version 1.24. Looks like an issue somewhere in the dependency tree.

Thanks!

@domeckert
Copy link
Owner

Thanks for the report @jdeplaa . As you're saying this looks like an upstream issue, i.e. an incompatibility between pytensor and numpy. I'll try to reproduce the error and if necessary, will report a bug to the pytensor people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants