I am using a Raspberry Pi OS 64-bit to run a script that will capture an image. I have gone through installing the right packages for libcamera for this OS and can run libcamera apps using my terminal. I get the error: no module named picamera2 whenever I try to run the script in thonny ide.

However, I have set my pythonpath variable to


and when I run the command "thonny&" or "thonny" from my terminal, my script runs without an error

Please, how can I be able to run my scripts without having to go through this process?

2 Answers 2


thonny is an integrated development environment for Python that is designed for beginners. If you just want to run a python program forget thonny and just run with python!

All my python scripts start with:-

#! /usr/bin/env python3

so they can be run from terminal.

Alternately just run python3 scriptname

  • hi, milliways. thank you, I'll do that. I wanted to know if there was a way it could be run from thonny itself, cause i'm making changes to my code, and it'll be easier if I could be testing directly from the ide. May 9, 2022 at 4:20

You can set an Environment variable in Thonny under (Tools:Options:General), which will persist after a closedown/restart of Thonny.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.