# Issues with numpy with built version of ParaView

**URL:** https://discourse.paraview.org/t/issues-with-numpy-with-built-version-of-paraview/12022
**Category:** ParaView Support
**Tags:** python
**Created:** [May 4, 2023, 1:20pm UTC](https://discourse.paraview.org/t/issues-with-numpy-with-built-version-of-paraview/12022 "2023-05-04T13:20:50Z")
**Posts on this page:** 3
**Page:** 1

<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: [May 4, 2023, 1:20pm UTC](https://discourse.paraview.org/t/issues-with-numpy-with-built-version-of-paraview/12022/1 "2023-05-04T13:20:51Z")

</div>

Hi,

I’m building ParaView (I get the same issue with VTK) and when I run `pvpython` I can’t import numpy. I can import numpy using my system Python, which my ParaView is built against. It looks like it’s my Python sys.path which is confused, possibly due to a non-standard install location of MPI. When I run pvpython this is what I get:

```auto
[acbauer@dsrclxerd5621m debug]$ bin/pvpython 
Python 3.6.8 (default, Jan 11 2023, 08:43:50) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/home/acbauer/Code/ParaView/debug/lib64/python3.6/site-packages', '/usr/local/mpich/usr/lib64/python36.zip', '/usr/local/mpich/usr/lib64/python3.6', '/usr/local/mpich/usr/lib64/python3.6/lib-dynload', '/usr/local/mpich/usr/lib64/python3.6/site-packages', '/usr/local/mpich/usr/lib/python3.6/site-packages']
>>> import numpy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'

```

When I just run Python, i.e. Python 3.6.8, I get the following:

```auto
[acbauer@dsrclxerd5621m debug]$ python3 --version
Python 3.6.8
[acbauer@dsrclxerd5621m debug]$ python3
Python 3.6.8 (default, Jan 11 2023, 08:43:50) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/usr/lib64/python3.6/site-packages', '/usr/lib/python3.6/site-packages']
>>> import numpy

```

If I add [‘’, ‘/usr/lib64/python36.zip’, ‘/usr/lib64/python3.6’, ‘/usr/lib64/python3.6/lib-dynload’, ‘/usr/lib64/python3.6/site-packages’, ‘/usr/lib/python3.6/site-packages’] to my sys.path for pvpython everything works fine (see below). Any hints on how to change my ParaView (and VTK) build to include the proper sys.path for numpy?

```auto
[acbauer@dsrclxerd5621m debug]$ bin/pvpython 
Python 3.6.8 (default, Jan 11 2023, 08:43:50) 
[GCC 8.5.0 20210514 (Red Hat 8.5.0-16)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path = sys.path + ['', '/usr/lib64/python36.zip', '/usr/lib64/python3.6', '/usr/lib64/python3.6/lib-dynload', '/usr/lib64/python3.6/site-packages', '/usr/lib/python3.6/site-packages']
>>> import numpy
>>> 

```

Thanks,  
Andy

---

<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, 2023, 11:46am UTC](https://discourse.paraview.org/t/issues-with-numpy-with-built-version-of-paraview/12022/2 "2023-05-16T11:46:30Z")

</div>

ParaView packages “bring” their Python environment with them. While it may _use_ your system libraries, `pvpython` is going to act like the root of its own Python distribution.

On the other hand, there are some oddities here. Such as why `/usr/local/mpich` shows up… Some debugging of `site.py` may be necessary to learn how the default paths are being built up here. Is there some loaded module interfering perhaps?

---

<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: [May 16, 2023, 12:37pm UTC](https://discourse.paraview.org/t/issues-with-numpy-with-built-version-of-paraview/12022/3 "2023-05-16T12:37:49Z")

</div>

Thanks for the reply. My `os.path` under `pvpython` was pointing to a location that was relative to my mpich install that was in a non-standard location. I think that install brought in a bunch of other things that caused some issues. Once I got my `os.path` issue fixed things were working as desired.
