Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Can't import aesara on windows : FileNotFoundError  #1236

@lt-brs

Description

@lt-brs

Can't import aesara on windows : FileNotFoundError

When I try to import aesara, the following error is raised. I'm working on Windows 10, 64bits.
Most surprisingly, the error occur in a jupyter-notebook but not in VS Code.

Please provide a minimal, self-contained, and reproducible example.

import aesara

Please provide the full traceback of any errors.

---------------------------------------------------------------------------
NoSectionError                            Traceback (most recent call last)
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\configparser.py:237, in AesaraConfigParser.fetch_val_for_key(self, key, delete_key)
    236 try:
--> 237     return self._aesara_cfg.get(section, option)
    238 except InterpolationError:
File ~\anaconda3\envs\prism_prod\lib\configparser.py:781, in RawConfigParser.get(self, section, option, raw, vars, fallback)
    780 try:
--> 781     d = self._unify_values(section, vars)
    782 except NoSectionError:
File ~\anaconda3\envs\prism_prod\lib\configparser.py:1152, in RawConfigParser._unify_values(self, section, vars)
   1151     if section != self.default_section:
-> 1152         raise NoSectionError(section) from None
   1153 # Update with the entry specific variables
NoSectionError: No section: 'blas'
During handling of the above exception, another exception occurred:
KeyError                                  Traceback (most recent call last)
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\configparser.py:353, in ConfigParam.__get__(self, cls, type_, delete_key)
    352 try:
--> 353     val_str = cls.fetch_val_for_key(self.name, delete_key=delete_key)
    354     self.is_default = False
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\configparser.py:241, in AesaraConfigParser.fetch_val_for_key(self, key, delete_key)
    240 except (NoOptionError, NoSectionError):
--> 241     raise KeyError(key)
KeyError: 'blas__ldflags'
During handling of the above exception, another exception occurred:
FileNotFoundError                         Traceback (most recent call last)
Cell In [2], line 1
----> 1 import aesara
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\__init__.py:120
    116     return as_tensor_variable(x, **kwargs)
    119 # isort: off
--> 120 from aesara import scalar, tensor
    121 from aesara.compile import (
    122     In,
    123     Mode,
   (...)
    129     shared,
    130 )
    131 from aesara.compile.function import function, function_dump
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\tensor\__init__.py:105
    103 # adds shared-variable constructors
    104 from aesara.tensor import sharedvar  # noqa
--> 105 from aesara.tensor import (  # noqa
    106     blas,
    107     blas_c,
    108     blas_scipy,
    109     nnet,
    110     xlogx,
    111 )
    112 import aesara.tensor.rewriting
    115 # isort: off
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\tensor\blas.py:162
    160 from aesara.scalar import bool as bool_t
    161 from aesara.tensor import basic as at
--> 162 from aesara.tensor.blas_headers import blas_header_text, blas_header_version
    163 from aesara.tensor.elemwise import DimShuffle, Elemwise
    164 from aesara.tensor.exceptions import NotScalarConstantError
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\tensor\blas_headers.py:1015
    997             header += textwrap.dedent(
    998                 """\
    999                     static float sdot_(int* Nx, float* x, int* Sx, float* y, int* Sy)
   (...)
   1009                     """
   1010             )
   1012     return header + blas_code
-> 1015 if not config.blas__ldflags:
   1016     _logger.warning("Using NumPy C-API based implementation for BLAS functions.")
   1019 def mkl_threads_text():
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\configparser.py:357, in ConfigParam.__get__(self, cls, type_, delete_key)
    355 except KeyError:
    356     if callable(self.default):
--> 357         val_str = self.default()
    358     else:
    359         val_str = self.default
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\link\c\cmodule.py:2863, in default_blas_ldflags()
   2861 if any("mkl" in fl for fl in ret):
   2862     ret.extend(["-lm", "-lm"])
-> 2863 res = try_blas_flag(ret)
   2864 if res:
   2865     if "mkl" in res:
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\link\c\cmodule.py:1995, in try_blas_flag(flags)
   1992 path_wrapper = '"' if os.name == "nt" else ""
   1993 cflags.extend([f"-L{path_wrapper}{d}{path_wrapper}" for d in std_lib_dirs()])
-> 1995 res = GCC_compiler.try_compile_tmp(
   1996     test_code, tmp_prefix="try_blas_", flags=cflags, try_run=True
   1997 )
   1998 # res[0]: shows successful compilation
   1999 # res[1]: shows successful execution
   2000 if res and res[0] and res[1]:
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\link\c\cmodule.py:2396, in GCC_compiler.try_compile_tmp(cls, src_code, tmp_prefix, flags, try_run, output, comp_args)
   2383 @classmethod
   2384 def try_compile_tmp(
   2385     cls,
   (...)
   2391     comp_args=True,
   2392 ):
   2393     return cls._try_compile_tmp(
   2394         src_code,
   2395         tmp_prefix,
-> 2396         cls.patch_ldflags(flags),
   2397         try_run,
   2398         output,
   2399         config.cxx,
   2400         comp_args,
   2401     )
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\link\c\cmodule.py:2434, in GCC_compiler.patch_ldflags(flag_list)
   2432 if not libs:
   2433     return flag_list
-> 2434 libs = GCC_compiler.linking_patch(lib_dirs, libs)
   2435 for flag_idx, lib in zip(flag_idxs, libs):
   2436     flag_list[flag_idx] = lib
File ~\anaconda3\envs\prism_prod\lib\site-packages\aesara\link\c\cmodule.py:2455, in GCC_compiler.linking_patch(lib_dirs, libs)
   2451 for lib_dir in lib_dirs:
   2452     lib_dir = lib_dir.strip('"')
   2453     windows_styled_libs = [
   2454         fname
-> 2455         for fname in os.listdir(lib_dir)
   2456         if not (os.path.isdir(os.path.join(lib_dir, fname)))
   2457         and fname.split(".")[0] == lib
   2458         and fname.split(".")[-1] in ["dll", "lib"]
   2459     ]
   2460     if windows_styled_libs:
   2461         selected_lib = sorted(windows_styled_libs, key=sort_key)[-1]
FileNotFoundError: [WinError 3] Le chemin daccès spécifié est introuvable: 'D:\\a\\1\\s\\numpy\\build\\openblas_info'

Versions and main components

  • Aesara version: 2.8.2
  • Aesara config (python -c "import aesara; print(aesara.config)") : can't import aesara
  • Python version: 3.9.11
  • Operating system: Windows 64 bits
  • How did you install Aesara: (conda/pip) pip (via poetry)

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