# Adding ParaView as a dependency to a Python project

**URL:** https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649
**Category:** ParaView Support
**Tags:** python
**Created:** [May 16, 2024, 9:38pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649 "2024-05-16T21:38:05Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![guillaumedavidphd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/e274bd/32.png) [@guillaumedavidphd](https://discourse.paraview.org/u/guillaumedavidphd)
#### Post date: [May 16, 2024, 9:38pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/1 "2024-05-16T21:38:05Z")

</div>

I’m building an application using the `paraview.simple` module. To enable CI and generally simplify things, I’d like to include ParaView (PV) as a dependency of my project (I use `poetry`, my dependencies are in a `pyproject.toml` file). I see there exists a `paraview` Anaconda package [here](https://anaconda.org/conda-forge/paraview), but I couldn’t find an equivalent on PyPI. Hence the question, how can I add PV as a dependency? Is it at all possible?

If not possible, what’s the best option? I can think of:

- asking the user to install PV manually in the documentation and create the necessary symlinks in the virtual environment
- scripting the download of PV and creation of symlinks

I’m aware I could use `pvpython` instead of a separate virtual environment, but that doesn’t suit my needs.

Any help would be greatly appreciated!

-Guillaume

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [May 16, 2024, 10:45pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/2 "2024-05-16T22:45:49Z")

</div>

You can use PV with a virtual-environment

---

<div class="post-metadata">

### Author: ![guillaumedavidphd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/e274bd/32.png) [@guillaumedavidphd](https://discourse.paraview.org/u/guillaumedavidphd)
#### Post date: [May 16, 2024, 10:53pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/3 "2024-05-16T22:53:02Z")

</div>

Thanks for your message! Could you elaborate a bit:

- What do you mean exactly?
- How do I do that? Do you have a reference?

---

<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 31, 2024, 11:43am UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/4 "2024-05-31T11:43:52Z")

</div>

> [@guillaumedavidphd](#):
>
> - What do you mean exactly?

He means that you can make a venv and tell ParaView (`pvpython`) to use that. ParaView is really difficult to make into a wheel at this time, so PyPI distribution isn’t really on the schedule at all.

> [@guillaumedavidphd](#):
>
> - How do I do that? Do you have a reference?

@jourdain?

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [June 4, 2024, 6:50pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/5 "2024-06-04T18:50:56Z")

</div>

> [@guillaumedavidphd](#):
>
> How do I do that? Do you have a reference?

```auto
python3.10 -m venv py-env # make sure you use the same python version as your instance of paraview uses
source py-env/bin/activate
pip install <packages you need>
<paraview>/bin/pvpython script.py --venv ./py-env

```

---

<div class="post-metadata">

### Author: ![guillaumedavidphd](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/g/e274bd/32.png) [@guillaumedavidphd](https://discourse.paraview.org/u/guillaumedavidphd)
#### Post date: [June 10, 2024, 6:26pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/6 "2024-06-10T18:26:44Z")

</div>

Thanks @ben.boeckel & @Christos_Tsolakis for the replies. I’ll test this approach and report back if I run into issues. I also have to think a bit more about how this fits into my goal.

---

<div class="post-metadata">

### Author: ![jmb64](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/258eb7/32.png) [@jmb64](https://discourse.paraview.org/u/jmb64)
#### Post date: [December 9, 2024, 6:48pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/7 "2024-12-09T18:48:18Z")

</div>

Hi,

```
 Just to make sure before spending too much time on pvpython using an extra virtual 

```

environment … Am I right in assuming that I can add a virtual environment without building  
ParaView from scratch ? I’m actually using Paraview (5.13.0) **binaries** which come with python 3.10.13. (So I created my own virtual environment pvextra based on python 3.10.13, installing a few python modules: xarray, pyvista and geovista).

I’m getting this memory corruption error …

pvpython --venv /home/jmb001/.venv/pvextra my\_script.py  
Error message:

> Blockquote

ParaView is using venv: /home/jmb001/.venv/pvextra  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1295 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1487 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1264 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1303 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1261 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1269 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1262 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1298 characters)  
PyVista error in handling VTK error message:  
‘WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:root:WARNING:r’ … (1261 characters)  
free(): invalid pointer  
error: exception occurred: Subprocess aborted

> Blockquote

Thanks,  
Jean-Marc

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [December 9, 2024, 7:18pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/8 "2024-12-09T19:18:16Z")

</div>

```auto
pvpython --venv /home/jmb001/.venv /path/to/script.py  

```

Also side note, PyVista will install VTK inside the venv which will conflict with the one available on ParaView. So make sure you remove vtk from the venv.

---

<div class="post-metadata">

### Author: ![jmb64](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/258eb7/32.png) [@jmb64](https://discourse.paraview.org/u/jmb64)
#### Post date: [December 9, 2024, 7:29pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/9 "2024-12-09T19:29:30Z")

</div>

Thanks Sebastien,

```
 Oupss! vtk ... good point.

 Sorry to insist: :-)
 I assume adding my virtual environment without building ParaView from scratch is OK ?

```

Jean-Marc

---

<div class="post-metadata">

### Author: ![jourdain](https://discourse.paraview.org/user_avatar/discourse.paraview.org/jourdain/32/11_2.png) [@jourdain](https://discourse.paraview.org/u/jourdain)
#### Post date: [December 10, 2024, 4:00pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/10 "2024-12-10T16:00:16Z")

</div>

yes I do that everyday.

---

<div class="post-metadata">

### Author: ![jmb64](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/j/258eb7/32.png) [@jmb64](https://discourse.paraview.org/u/jmb64)
#### Post date: [December 10, 2024, 4:10pm UTC](https://discourse.paraview.org/t/adding-paraview-as-a-dependency-to-a-python-project/14649/11 "2024-12-10T16:10:11Z")

</div>

Good. Appreciate it.
