Fresh install of DietPi, can't access any python modules

I’m new to DietPi. I have a fresh install, fully updated on a RPI4. I’ve installed python3 using dietpi-software system.

I can’t access any modules, either installed using the module’s setup.py or installed using pip3. I just get ‘No module named ’ error.

I’m trying to run a python script that worked without issue on Raspbian Lite.

I’d appreciate any advice.

Welcome to our community.

Can you share the command you are using to run your script.

Thank you.

Yes absolutely. I am simply using:

sudo python3 myscript.py

(sudo because I call a library which needs root privileges at startup)

Did you tried to use full path to your script

sudo python3 /path/to/your/myscript.py

Yeah, I’m calling my script which loads fine. The problem is when my script tries to import modules. Any module my script imports that was installed via pip3 or directly fails with ‘No module named *****’ error.

It would be helpful if you could share some error message. Does your script is using an own user pyenv?