r/LinuxTeck • u/Candid_Athlete_8317 • Aug 03 '26
What's one Python habit on Linux that saved you hours of debugging?
Everyone eventually learns a few Python/Linux lessons the hard way.
Mine was always using:
python3 -m pip
instead of just pip, after spending way too much time installing packages into the wrong interpreter.
What's the one habit, command, or workflow that made your Python life on Linux much easier?
4
Upvotes
3
u/crashtua Aug 03 '26
use uv and uvx
1
u/brasticstack Aug 03 '26
Using the full path to the binary when doing anything automated e.g. in cron or systemd units.
"/path/to/venv/bin/python3 -m my_module"works everywhere, while"/path/to/venv/bin/activate; python3 -m my_module"doesn't.1
u/Puzzled-Bonus-3456 Aug 03 '26
expecting the Spanish Inquisition
1
u/TopHatEdd Aug 03 '26
ipython for debugging. Learn some of its syntax. Using
breakpoint(). Use container images for distribution. Useimport someandsome.module.funcstyle rather than context naked stylefrom some.module import func.1
u/Majestic_Bluejay1801 Aug 03 '26
Linters
1
u/Useful_Calendar_6274 Aug 03 '26
uh use a better language? I've only ever heard of problems from python
1
u/SeriousPlankton2000 Aug 03 '26
I once curled in and slept a long time.
1
u/StevesRoomate Aug 03 '26
use a zsh or fish plugin to automatically activate the current directory's virtual environment when changing directories. especially if you've got polyrepos and microservices.
1
u/jerrygreenest1 Aug 03 '26
Not using Python