# Python Script fails to load modules

**URL:** https://discourse.paraview.org/t/python-script-fails-to-load-modules/9540
**Category:** ParaView Support
**Tags:** python
**Created:** [April 29, 2022, 3:49pm UTC](https://discourse.paraview.org/t/python-script-fails-to-load-modules/9540 "2022-04-29T15:49:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Francesco97](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/f/2bfe46/32.png) [@Francesco97](https://discourse.paraview.org/u/Francesco97)
#### Post date: [April 29, 2022, 3:49pm UTC](https://discourse.paraview.org/t/python-script-fails-to-load-modules/9540/1 "2022-04-29T15:49:47Z")

</div>

Hello everyone, I’m doing my thesis with OpenFOAM and I have to use Python-Paraview to plot some results of the simulation I’m doing. As I am pretty new with Python-Paraview coupling I’m not able to solve this problem by myself. Actually I am trying to run the pv\_post\_processing.py file it was created by other students before me in the terminal (I have a MacOS laptop), and this is the error I obtain:

> > > from paraview.simple import \*  
> > > Traceback (most recent call last):  
> > > File “/Applications/ParaView-5.10.1.app/Contents/Python/paraview/ **init**.py”, line 257, in   
> > > from .modules import vtkRemotingCore  
> > > ImportError: dlopen(/Applications/ParaView-5.10.1.app/Contents/Python/paraview/modules/vtkRemotingCore.so, 0x0002): Library not loaded: @executable\_path/…/Libraries/libvtkRemotingCore-pv5.10.5.10.dylib  
> > > Referenced from: /Applications/ParaView-5.10.1.app/Contents/Python/paraview/modules/vtkRemotingCore.so  
> > > Reason: tried: ‘/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/Resources/Python.app/Contents/MacOS/…/Libraries/libvtkRemotingCore-pv5.10.5.10.dylib’ (no such file), ‘/usr/local/lib/libvtkRemotingCore-pv5.10.5.10.dylib’ (no such file), ‘/usr/lib/libvtkRemotingCore-pv5.10.5.10.dylib’ (no such file)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “”, line 1, in   
File “/Applications/ParaView-5.10.1.app/Contents/Python/paraview/ **init**.py”, line 259, in   
import \_paraview\_modules\_static  
ModuleNotFoundError: No module named ‘\_paraview\_modules\_static’

To make a point regarding that, I am running this thing in a venv with python in it, and it seems that it looks for the libraries in the homebrew directory where python is also installed. Other than that I also specified the python path as follows:

export PYTHONPATH=/Applications/ParaView-5.10.1.app/Contents/Python

Has someone any suggestions regarding this? I am really struggling to find a solution and if someone has any idea it would be really helpful. (Python version=3.9.12, ParaView version=5.10.1)

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.paraview.org/u/ben.boeckel)
#### Post date: [May 16, 2022, 12:42am UTC](https://discourse.paraview.org/t/python-script-fails-to-load-modules/9540/2 "2022-05-16T00:42:13Z")

</div>

The application libraries are pinned to the bundle (via `@executable_path`). You can hack it up by running your executable from `ParaView.app/Contents/bin` or some other sibling directory.
