Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4814

Python • Re: Keep getting this error message

$
0
0
I can confirm that since putting in a clean OS, that due to upgrading Python, for whatever reasons unbeknown only to me, kinda messed things up. All running smoothly now. And I can also confirm, I didn't use venv for running Python
The reasons are:

- Its the system's python interpreter, not yours. Therefore never upgrade it. The only way to safely upgrade/patch it is via upgrading/patching the os. Yes, it is nice that you can use it, but it is not yours to mess up with unless you're ready to accept things will break if you do.

- if you need a different version of Python, install your own side by side and specifically use that one. You can install dozens of Python versions side by side and they all work independently.

- that is exactly what venvs are for, you isolate your code from the system's and the side installed python interpreter while still being able to use whatever version of Python and libraries you want/need without wrecking the system's it side installed interpreter. Your code should be coded and used completely isolated from anything else changing. Things may change, but your code's env will not. Likewise, your code env will change as you need it to, but nothing else will.

Some worthwhile reading to understand it all https://realpython.com/python-virtual-e ... -a-primer/

Really required reading so you don't get stuck using someone else's code and with no idea why it does not work in your system when it works on others.

Statistics: Posted by memjr — Sat Jan 18, 2025 9:41 pm



Viewing all articles
Browse latest Browse all 4814

Trending Articles