<div dir="ltr"><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif">Hi,<br><br>I have been trying to configure the petsc4py package along with my PETSc installation for my research. I have searched for solutions on the internet but there was no luck, this is the error I get when I am trying to configure PETSC and use it to run examples of code that utilise the petsc4py package...</font></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"> File "/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/PETSc.py", line 3, in <module></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    PETSc = ImportPETSc(ARCH)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  File "/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/__init__.py", line 29, in ImportPETSc</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    return Import('petsc4py', 'PETSc', path, arch)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  File "/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/__init__.py", line 73, in Import</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    module = import_module(pkg, name, path, arch)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  File "/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/__init__.py", line 58, in import_module</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    with f: return imp.load_module(fullname, f, fn, info)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 242, in load_module</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    return load_dynamic(name, filename, file)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">  File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 342, in load_dynamic</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">    return _load(spec)</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">ImportError: dlopen(/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/arch-darwin-c-debug/<a href="http://petsc.cpython-39-darwin.so/" target="_blank">PETSc.cpython-39-darwin.so</a>, 2): no suitable image found.  Did find:</span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span style="white-space:pre-wrap">       </span>/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/arch-darwin-c-debug/<a href="http://petsc.cpython-39-darwin.so/" target="_blank">PETSc.cpython-39-darwin.so</a>:<span style="background-color:rgb(0,255,0)"> mach-o, but wrong architecture</span></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><span style="white-space:pre-wrap">   </span>/Users/veronikaulanova/Documents/documents/Oxford_work/petsc/arch-darwin-c-debug/lib/petsc4py/lib/arch-darwin-c-debug/<a href="http://petsc.cpython-39-darwin.so/" target="_blank">PETSc.cpython-39-darwin.so</a>: <span style="background-color:rgb(0,255,0)">stat() failed with errno=25</span></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;line-height:normal;margin:0px;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures"><font face="arial, sans-serif" style="">As you can see I am using an M1 mac and therefore that causes the petsc4py package to give me an error (highlighted above), but do you have any idea of how I can solve it or why it is even there? I know that the new M1 has a different architecture to intel macs but I have no idea of where to start with fixing this or how to make it work. Any help would be much appreciated, thank you in advance.<br><br>Kind Regards, Veronika</font></span></p></div>