# Simply add python modules

**URL:** https://discourse.paraview.org/t/simply-add-python-modules/11001
**Category:** ParaView Support
**Created:** [December 16, 2022, 7:15am UTC](https://discourse.paraview.org/t/simply-add-python-modules/11001 "2022-12-16T07:15:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ouxid](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/o/c2a13f/32.png) [@Ouxid](https://discourse.paraview.org/u/Ouxid)
#### Post date: [December 16, 2022, 7:15am UTC](https://discourse.paraview.org/t/simply-add-python-modules/11001/1 "2022-12-16T07:15:32Z")

</div>

Hi everyone.

I’d like to add pyarrow to pvpython so that it can read/write .parquet files.  
I managed on my local machine, but had to go through the quite tedious method of building paraview from scratch.

I’d like to know, since I want to share my code using .parquet with others, if there is a more straightforward way?  
I did find that using virtual environment could help, as explained here: [https://www.kitware.com/using-pvpython-and-virtualenv/](https://www.kitware.com/using-pvpython-and-virtualenv/)

The issue is that I seem to have conflict when I do so using the paraview version from the website. When I build my environment and then use the commands:

```auto
vEnv='/home/environments/paraview_env/bin/activate_this.py'
exec(open(vEnv).read(), {' __file__': vEnv})

```

Then it seems like simple libraries as numpy wont work anymore, with error as such as:

```auto
>>> import pandas as pd
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/ __init__.py", line 22, in <module>
    from pandas.compat import is_numpy_dev as _is_numpy_dev # pyright: ignore # noqa:F401
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/compat/ __init__.py", line 18, in <module>
    from pandas.compat.numpy import (
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/compat/numpy/ __init__.py", line 4, in <module>
    from pandas.util.version import Version
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/util/ __init__.py", line 2, in <module>
    from pandas.util._decorators import ( # noqa:F401
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly
  File "/home/boris/environments/paraview_env/lib/python3.10/site-packages/pandas/_libs/ __init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
ModuleNotFoundError: No module named 'pandas._libs.interval'

```

Meanwhile, if I import pandas without the venv, it works… Any clue, or other way of importing my modules?

Thank you!

---

<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 16, 2022, 6:03pm UTC](https://discourse.paraview.org/t/simply-add-python-modules/11001/2 "2022-12-16T18:03:47Z")

</div>

Not sure that is the issue here but you are using Python 3.10 while ParaView is using Python 3.9.

For your venv you need to have a version match.

---

<div class="post-metadata">

### Author: ![Ouxid](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/o/c2a13f/32.png) [@Ouxid](https://discourse.paraview.org/u/Ouxid)
#### Post date: [December 20, 2022, 8:30am UTC](https://discourse.paraview.org/t/simply-add-python-modules/11001/3 "2022-12-20T08:30:42Z")

</div>

Thanks for the idea.

I tried with python 3.9 virtualenv, same issue. And I also get this issue on windows OS.

To use virtual env, is it needed to have a self-compiled version? Or the installer from the website should be enough?

EDIT: Actually, for windows it works. No idea what was wrong the first time. For future readers, what I did is the following:

0- Download and install python 3.9  
1- Create a virtualenv and install pyarrow and fastparquet. To do so, use the command like

` python -m virtualenv -p="C:\Users\YourPath\AppData\Local\Programs\Python\Python39\python.exe" "Path/to/venv"`

2- Then, simply activate the script (.\Scripts\Activate.ps1 for powershell) and install your libraries  
3- Now, create an environment variable called PV\_VENV, and of value the path to your venv folder.  
4- You can check that the venv is indeed used through the python command inside paraview : `from paraview.web import venv `

Probably the commands from my first post also works, instead of the PV\_VENV.

Regarding why it does not work on ubuntu, I will try to look further into it.
