thonny ide pythonpath setup

Raspberry Pi
  1. Home
    1. PUBLIC
    2. Questions
    3. Tags
    4. Users
    5. Companies
    6. Unanswered
    1. TEAMS
    2. tlfong01

Script running from terminal after setting pythonpath and running “thonny&” command, but not when thonny ide is opened directly

Ask Question

Asked today

Modified today

Viewed 3 times


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?




edited 46 mins ago

user avatar


53k2525 gold badges8888 silver badges178178 bronze badges

asked 1 hour ago

user avatar

Uchechi Ugo

111 bronze badge

 New contributor

Add a comment

1 Answer

Sorted by:

Reset to default                                              Highest score (default)                                                                   Date modified (newest first)                                                                   Date created (oldest first)                              


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



answered 47 mins ago

user avatar


53k2525 gold badges8888 silver badges178178 bronze badges

  • 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. – Uchechi Ugo 1 min ago 

Add a comment

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.