5 ms·
"It's completely global" It doesn't have to be. You can have a launcher for a project that sets PYTHONPATH just when you launch that project. What is bad prac
by cturner 5y ago
"It's completely global"
It doesn't have to be. You can have a launcher for a project that sets PYTHONPATH just when you launch that project.
What is bad practice is to be setting PYTHONPATH in your .bashrc, and for the reason you give - that makes it global across python launches.
- doubleunplussed 5y agoThat'll prevent it leaking to most things, but not to subprocesses of your application. For example your application might interact with command-line tools written in Python, and unless you delete PYTHONPATH from the environment variables prior to launching any subprocesses, they'll inherit it. This could lead to subtle and confusing breakage.