# How to choose an exOS interpreter and environment?

**URL:** <https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721>\
**Category:** B&R Software & Runtime\
**Tags:** exos\
**Created:** [April 1, 2024, 3:00am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721 "2024-04-01T03:00:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mar](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@mar](https://community.br-automation.com/u/mar)\
**Post date:** [April 1, 2024, 3:00am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/1 "2024-04-01T03:00:24Z")

</div>

Hello, everyone.  
I get an error when I impot cv2 library in my exOS python program,  
how should I choose the environment for exOS program compilation.

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/5/58884c3fecbdf2c7fb04323f809e8d2542dc32a4.png)

I’ve installed numoy in the exOSTarget .

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/4/43c0b7ba95a53018761fd57e6d3d7d437ed75693.png)

---

<div class="post-metadata">

**Author:** ![patricthysell](https://avatars.discourse-cdn.com/v4/letter/p/FF8800/32.png) [@patricthysell](https://community.br-automation.com/u/patricthysell)\
**Post date:** [April 2, 2024, 6:28am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/2 "2024-04-02T06:28:43Z")

</div>

Hi @mar ,

This behavior comes from the fact that you have installed numpy for your user, and the exOS services run as root.

A simple means of testing this on the target is to try the command as root or as sudo. meaning either

```
su
python /path/to/your/script.py

```

or

```
sudo python /path/to/your/script.py

```

should produce the same problem, which gives you a simple means of testing before deploying when using additional libraries.

There are a lot of references on the web to solve this, whereas the general recommendation is to use virtual environments.

The simplest way, although not generally recommended (because it can create version conflicts between packages used by different users) is to install the numpy system wide. If you are “alone” on your target (which I assume), then you can go with:

```
su
pip install numpy

```

or

```
sudo pip install numpy

```

Again, theres a lot of public information in this topic, and several ways to solve this properly, which I would recommend digging deeper into.

If you are new to exOS, please have a look at the getting started:

> [@exOS FAQ & Getting Started](https://community.br-automation.com/t/exos-faq-getting-started/2397):
>
> Hi, First of all, thanks to everyone using exOS, and for your open spirit of using Linux in an industrial environment. I have gotten a number of questions, and there are a couple of things that are good to know, and not necessarily obvious when you start working with exos. If something doesn’t work as intended, check the Loggers check ExDeploy log first, regarding the installation status of the packages If installation seems fine (check ExComponentInfo) but you have problems with data comm…

happy coding

---

<div class="post-metadata">

**Author:** ![vanessaca](https://avatars.discourse-cdn.com/v4/letter/v/FF8800/32.png) [@vanessaca](https://community.br-automation.com/u/vanessaca)\
**Post date:** [April 2, 2024, 8:05am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/3 "2024-04-02T08:05:05Z")

</div>

Hi @mar,

did you already tried with the command `sudo apt install python3-opencv` ?

---

<div class="post-metadata">

**Author:** ![mar](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@mar](https://community.br-automation.com/u/mar)\
**Post date:** [April 2, 2024, 8:47am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/4 "2024-04-02T08:47:36Z")

</div>

Thank you very much for your explanation, it replied my doubts very well and I will read the guidance you mentioned again in detail

---

<div class="post-metadata">

**Author:** ![mar](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@mar](https://community.br-automation.com/u/mar)\
**Post date:** [April 2, 2024, 8:49am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/5 "2024-04-02T08:49:02Z")

</div>

Hi @vanessaca  
I’m not currently installing via sudo, I’ll give it a try here, thanks for the reply!

---

<div class="post-metadata">

**Author:** ![mar](https://avatars.discourse-cdn.com/v4/letter/m/FF8800/32.png) [@mar](https://community.br-automation.com/u/mar)\
**Post date:** [April 2, 2024, 8:49am UTC](https://community.br-automation.com/t/how-to-choose-an-exos-interpreter-and-environment/2721/6 "2024-04-02T08:49:23Z")

</div>

Hi @patricthysell  
Thank you very much for your explanation, it replied my doubts very well and I will read the guidance you mentioned again in detail.
