# Catalyst Python example Import Error no module named mpi4py

**URL:** https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280
**Category:** In Situ Support
**Created:** [January 7, 2020, 12:52am UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280 "2020-01-07T00:52:44Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![cylu361](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cylu361/32/2642_2.png) [@cylu361](https://discourse.paraview.org/u/cylu361)
#### Post date: [January 7, 2020, 12:52am UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/1 "2020-01-07T00:52:44Z")

</div>

Hi all! I’ve been trying to run the catalyst python full example but keep running into the same error.

I ran:  
`<local>/superbuild/catalyst/build/bin/pvpython fedriver.py cpscript.py`

I got:

```
Traceback (most recent call last):
  File "fedriver.py", line 19, in <module>
    from mpi4py import MPI
ImportError: No module named mpi4py

```

I built catalyst from the superbuild (version 5.6.2), and I added environment variables to PATH as according to the instructions at the top of the python example (in fedriver.py). This alleviated my problems with numpy, but oddly enough not mpi.

Any help would be appreciated, thank you in advance!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [January 7, 2020, 9:19am UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/2 "2020-01-07T09:19:57Z")

</div>

@nicolas.vuaille

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [January 7, 2020, 3:43pm UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/3 "2020-01-07T15:43:19Z")

</div>

Did you enable the MPI option in the ParaView superbuild? If you did, you may need to run `pvpython` with the `--mpi` flag or alternately run with `pvbatch` instead.

---

<div class="post-metadata">

### Author: ![cylu361](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cylu361/32/2642_2.png) [@cylu361](https://discourse.paraview.org/u/cylu361)
#### Post date: [January 7, 2020, 6:48pm UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/4 "2020-01-07T18:48:55Z")

</div>

I enabled catalyst, cxx11, mpi, numpy, png, and python in the superbuild, but not use system mpi.  
I got the same import error with pvbatch and using the --mpi flag with pvpython.

---

<div class="post-metadata">

### Author: ![Andy\_Bauer](https://discourse.paraview.org/user_avatar/discourse.paraview.org/andy_bauer/32/5442_2.png) [@Andy\_Bauer](https://discourse.paraview.org/u/Andy_Bauer)
#### Post date: [January 8, 2020, 9:51am UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/5 "2020-01-08T09:51:46Z")

</div>

I’m not at a place where it’s easy for me to check on the superbuild options but is there an mpi4py CMake option in the superbuild? It may be an advanced option. Also, are you using your system’s Python? I can’t remember all of the details with Python in the superbuild.

---

<div class="post-metadata">

### Author: ![cylu361](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cylu361/32/2642_2.png) [@cylu361](https://discourse.paraview.org/u/cylu361)
#### Post date: [January 9, 2020, 6:17am UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/6 "2020-01-09T06:17:46Z")

</div>

I’m using the 5.6.2 version of catalyst and there’s no mpi4py option during CMake. I didn’t enable USE\_SYSTEM\_python, so I believe it’s using the superbuild’s python.

---

<div class="post-metadata">

### Author: ![Dave\_DeMarle](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dave_demarle/32/27_2.png) [@Dave\_DeMarle](https://discourse.paraview.org/u/Dave_DeMarle)
#### Post date: [January 28, 2020, 12:19pm UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/7 "2020-01-28T12:19:37Z")

</div>

Are you on windows by chance? mpi4py was not packaged by the Superbuild (and thus our binaries either) up through 5.6 on windows, but was on Mac and Linuxe. I would have to check on the status after 5.7 with windows.

In any case building from source against a system Python that has mpi4py should work everywhere.

---

<div class="post-metadata">

### Author: ![cylu361](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cylu361/32/2642_2.png) [@cylu361](https://discourse.paraview.org/u/cylu361)
#### Post date: [January 31, 2020, 7:08pm UTC](https://discourse.paraview.org/t/catalyst-python-example-import-error-no-module-named-mpi4py/3280/8 "2020-01-31T19:08:30Z")

</div>

I am using Ubuntu Linux. I could not find the option even in advanced settings, but it’s possible that I missed it somehow.  
Regardless, I am now using newer versions, and will post again if I have trouble then.
