Import error

Issue #135 closed
Amin Sadeghi created an issue

Hi,

When I try from petsc4py import PETSc I get this error:

AttributeError: type object 'petsc4py.PETSc.array' has no attribute 'reduce_cython'

I would appreciate it if someone could let me know what went wrong.

Comments (4)

  1. Amin Sadeghi reporter

    Update 1: After I uninstalled mumps, I got the following error when trying to import PETSc:

    >>> from petsc4py import PETSc
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/site-packages/petsc4py/PETSc.py", line 3, in <module>
        PETSc = ImportPETSc(ARCH)
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/site-packages/petsc4py/lib/__init__.py", line 29, in ImportPETSc
        return Import('petsc4py', 'PETSc', path, arch)
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/site-packages/petsc4py/lib/__init__.py", line 73, in Import
        module = import_module(pkg, name, path, arch)
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/site-packages/petsc4py/lib/__init__.py", line 58, in import_module
        with f: return imp.load_module(fullname, f, fn, info)
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/imp.py", line 242, in load_module
        return load_dynamic(name, filename, file)
      File "/home/amin/anaconda3/envs/pmeal/lib/python3.7/imp.py", line 342, in load_dynamic
        return _load(spec)
      File "PETSc/PETSc.pyx", line 111, in init petsc4py.PETSc
    ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
    

  2. Amin Sadeghi reporter

    Update 2: I’m almost sure that mumps package is the culprit. After uninstalling mumps, I reinstalled numpy ans scipy and then I could import PETSc without any trouble. So, I guess installing mumps causes some dependency mismatch.

  3. Lisandro Dalcin

    Maybe the mumps package is outdated and has to be rebuilt. But this is not the right place to discuss these installations issues, you should use the conda-forge/petsc4py-feedstock in github, and post the full output of conda install petsc4py in a fresh environment.

  4. Log in to comment