How to install Python Packages

I need to install a python package that is not currently available:

AHRS · PyPI

Yesterday I was able to do a pip3 install ahrs and it seemed to work but it is not recognized in they Python sketch when I do

from ahrs.filters import Madgwick

Tried reinstalling this morning after the recent update and seems things broke so does not seem to work anymore.

Thanks in advance

I don't know anything about Python, but I bet for you to get some help, you will need at a minimum the OS you are using, which board you are using, and I suspect more.

Well since this is a Arduino Q forum I would have thought it was obvious that I am using a Arduino Q. And since I am asking about Python I must be on linux side with the qualcomm chip. Didn’t think I need to specify:
Arduino Q

using .\adb shell

and trying

pip3 install ahrs.

Thought it would be obvious - guess not!

Durn, I need to remember to look at the top of the page.

For documentation I did find in another post that

To add Python packages to your application, select the main.py file and click on the “Add file“ icon. Create a requirements.txt file and list the Python packages you need. See Requirements File Format - pip documentation v25.2 for more information.

Sorry forgot where I found this but think it was written by @manchuino in Arduino Q info Tkinter - UNO Family / UNO Q - Arduino Forum

Now question is once it installs the package do I still need to keep requirements.txt. Also, can I use pip3 if in activate venv at

Activating python virtual environment Using Python 3.13.9 environment at: .cache/.venv

Hi @Merlin513. Note that the Python script of the App is running in an isolated environment inside a Docker container:

Conversely, the shell you reach via adb shell is in the global environment of the Linux machine.

Morning @ptillisch . Thanks for the explanation. I did finally manage to get my test app working late last night where I am sending accel/gyro/mag data from the arduino to linux and then sending roll/pitch/yaw back to the arduino. Quite a learning experience.

Any plans for a Bridge for dummies tutorial :slight_smile:

Hello everyone, I'm in the same situation as @Merlin513 so earlier I opened a new thread

@Merlin513 how were you able to install successfully that package?

Think you found your answer in the other thread about adding a requirements.txt file under python and then adding your python package to the file.

Hello so, I used requirements.txt and selected matplotlib but it´s not working also if I use the plotly library ask me for using chrome which technically I should be able to use chromium of the uno Q so, is there a way I can download matplotlib with requirements without getting " ModuleNotFoundError: No module named 'matplotlib'"?

Hi @apicadot1.

If you don't mind sharing it, please provide your full App so that we can examine it to try to understand the cause of the error.

I'll provide instructions you can follow to do that:

  1. Start Arduino App Lab and connect it to your UNO Q board (if using the board in PC hosted mode).
  2. Open the App.
  3. Click the located after the App name near the top left hand corner of the Arduino App Lab window.
    A menu will open.
  4. Select "Export App" from the menu.
    The "Export app" dialog will open.
  5. Click the "Export .zip" button in the "Export app" dialog.
    The "Export App" dialog will open.
  6. Select any convenient location to save the exported app in the dialog.
  7. Click the "Save" button in the dialog.
    The dialog will close.
  8. Open a reply here on this forum topic by clicking the "Reply" button.
  9. Click the "Upload" icon (Upload icon) on the post composer toolbar:

    The "Open" dialog will open.
  10. Navigate to the location you chose for the exported App during the previous step in these instructions.
  11. Select the .zip file of the exported App.
  12. Click the "Open" button.
    The dialog will close.
  13. Click the "Reply" button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps 9 - 12 above, you can simply drag and drop the .zip file onto the post composer field to attach it.