0
$\begingroup$

I tried to run an example PETSC program in python. I used pyinstaller --onefile example.py to create a binary form and mpiexec -n 2 ./example -start_in_debugger to run the program and got following error:

Traceback (most recent call last):
  File "example.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "/home/ninja/anaconda3/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "petsc4py/PETSc.py", line 3, in <module>
  File "petsc4py/lib/__init__.py", line 28, in ImportPETSc
  File "petsc4py/lib/__init__.py", line 38, in getPathArchPETSc
  File "petsc4py/lib/__init__.py", line 89, in getPathArch
ValueError: invalid path: '/home/ninja/_MEI0VXpWU/petsc4py/lib'
[21279] Failed to execute script example
Traceback (most recent call last):
  File "example.py", line 2, in <module>
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "/home/ninja/anaconda3/lib/python3.8/site-packages/PyInstaller/loader/pyimod03_importers.py", line 493, in exec_module
    exec(bytecode, module.__dict__)
  File "petsc4py/PETSc.py", line 3, in <module>
  File "petsc4py/lib/__init__.py", line 28, in ImportPETSc
  File "petsc4py/lib/__init__.py", line 38, in getPathArchPETSc
  File "petsc4py/lib/__init__.py", line 89, in getPathArch
ValueError: invalid path: '/home/ninja/_MEINoibSU/petsc4py/lib'
[21280] Failed to execute script example
-------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpiexec detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[24678,1],1]
  Exit code:    255
--------------------------------------------------------------------------

pip show petsc shows me:

Name: petsc
Version: 3.14.1
Summary: PETSc: Portable, Extensible Toolkit for Scientific Computation
Home-page: https://www.mcs.anl.gov/petsc/
Author: PETSc Team
Author-email: petsc-maint@mcs.anl.gov
License: BSD
Location: /home/ninja/.local/lib/python3.8/site-packages

and pip show petsc4py:

Name: petsc4py
Version: 3.14.0
Summary: PETSc for Python
Home-page: https://gitlab.com/petsc/petsc4py
Author: Lisandro Dalcin
Author-email: dalcinl@gmail.com
License: BSD
Location: /home/ninja/Dokumenty/parallel/petsc/arch-linux-c-debug/lib
Requires: numpy
Required-by: 

Has anyone idea where that faulty path comes from and how to fix it?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.