# How to install Aravis to be Used with Python

**URL:** <https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512>\
**Category:** Community\
**Created:** [August 17, 2022, 11:30am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512 "2022-08-17T11:30:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harley](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/harley/32/184_2.png) [@Harley](https://aravis-project.discourse.group/u/Harley)\
**Post date:** [August 17, 2022, 11:30am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/1 "2022-08-17T11:30:30Z")

</div>

Hello,  
I am a beginner to linux so sorry for not understanding some of the terminology but i am having trouble installing Aravis onto my raspberry pi4 with DebianOS. From the limited resources i could find i have followed many tutorials to no avail including this one([Using GigE Cameras with \<br\> Aravis | OpenCV | Gstreamer [\<span class="caps"\>UPDATED\</span\>] - BitsMakeMeCrazy \<br\> Kushal Vyas's Blog](https://kushalvyas.github.io/gige_ubuntu.html)) Using meson i think i have successfully ‘Built’ Aravis but now i think i am having trouble with having python “See” the Aravis library if that makes sence when i try to make a python script with

```auto
import gi
gi.require_version ('Aravis', '0.8')
from gi.repository import Aravis

```

It stops on the second line with,  
raise ValueError(‘Namespace %s not avaliable’ % namespace )  
ValueError: Namespace Aravis not avaliable

I would appreciate the help as i think aravis is my solution to accessing a GigE camera on a raspberry pi. Thank you for your response.

---

<div class="post-metadata">

**Author:** ![Emmanuel](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/emmanuel/32/198_2.png) [@Emmanuel](https://aravis-project.discourse.group/u/Emmanuel)\
**Post date:** [August 21, 2022, 12:54pm UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/2 "2022-08-21T12:54:42Z")

</div>

Hi,

Depending on where you have installed Aravis (`/usr/local` by default), you may have to set the `GI_TYPELIB_PATH` environment variable, and may be `LD_LIBRARY_PATH`.

---

<div class="post-metadata">

**Author:** ![eudoxos](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/eudoxos/32/116_2.png) [@eudoxos](https://aravis-project.discourse.group/u/eudoxos)\
**Post date:** [August 29, 2022, 7:30am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/3 "2022-08-29T07:30:54Z")

</div>

I was using Aravis at RPi3, no problems. I’d suggest you use the packaged version of Aravis; you will need the [gir1.2-aravis-0.8](https://packages.debian.org/bullseye/gir1.2-aravis-0.8) package for Python. The you should not need any of `GI_TYPELIB_PATH` or `LD_LIBRARY_PATH` since the packages put files in to standard locations.

Did you not just forget to install, after building?

---

<div class="post-metadata">

**Author:** ![Harley](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/harley/32/184_2.png) [@Harley](https://aravis-project.discourse.group/u/Harley)\
**Post date:** [August 29, 2022, 7:59am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/4 "2022-08-29T07:59:03Z")

</div>

So i download that package you linked and just have it in same directory as my .py file? Then i should be able to just straight “import Aravis” or through gi like in my original post.

---

<div class="post-metadata">

**Author:** ![eudoxos](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/eudoxos/32/116_2.png) [@eudoxos](https://aravis-project.discourse.group/u/eudoxos)\
**Post date:** [August 29, 2022, 8:12am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/5 "2022-08-29T08:12:27Z")

</div>

Install the package via `apt` like other programs (see [RPi OS APT](https://www.raspberrypi.com/documentation/computers/os.html#using-apt)), so it will be something like `sudo apt install gir1.2-aravis-0.8` in the terminal.

---

<div class="post-metadata">

**Author:** ![Harley](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/harley/32/184_2.png) [@Harley](https://aravis-project.discourse.group/u/Harley)\
**Post date:** [August 29, 2022, 1:03pm UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/6 "2022-08-29T13:03:42Z")

</div>

And then it will allow me to just “import Aravis” in a python file? Thanks for your patience ill give it a try tomorrow.

---

<div class="post-metadata">

**Author:** ![eudoxos](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/eudoxos/32/116_2.png) [@eudoxos](https://aravis-project.discourse.group/u/eudoxos)\
**Post date:** [September 22, 2022, 9:59am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/7 "2022-09-22T09:59:00Z")

</div>

Then you do like you originally wrote

```python
import gi
gi.require_version ('Aravis', '0.8')
from gi.repository import Aravis

```

See e.g. [here](https://github.com/eudoxos/vrmagic-aravis/blob/master/python/single-frame.py) for the same (older Aravis version).

---

<div class="post-metadata">

**Author:** ![Harley](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/harley/32/184_2.png) [@Harley](https://aravis-project.discourse.group/u/Harley)\
**Post date:** [September 24, 2022, 5:50am UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/8 "2022-09-24T05:50:14Z")

</div>

Now i can import with no errors, Now how would i be able to get frames from my Gige camera to be used with opencv for image processing. All inm python btw thanks for your help

---

<div class="post-metadata">

**Author:** ![eudoxos](https://yyz2.discourse-cdn.com/free1/user_avatar/aravis-project.discourse.group/eudoxos/32/116_2.png) [@eudoxos](https://aravis-project.discourse.group/u/eudoxos)\
**Post date:** [September 24, 2022, 12:17pm UTC](https://aravis-project.discourse.group/t/how-to-install-aravis-to-be-used-with-python/512/9 "2022-09-24T12:17:55Z")

</div>

Look e.g. [here](https://www.freelists.org/post/aravis/Getting-Thermal-Imaging-data-using-python-and-ARAVIS,1) for an example (`pup_buffer`, `get_data`, then conversion to `np.array` — opencv in python uses `np.array` for images).
