r/programminghorror • u/[deleted] • Jan 12 '22
Python environment
https://imgs.xkcd.com/comics/python_environment.png[removed] — view removed post
1.4k
Upvotes
r/programminghorror • u/[deleted] • Jan 12 '22
[removed] — view removed post
12
u/abcteryx Jan 12 '22
Never mind the fact that installing Python from python.org on Windows doesn't let you just run
pythonorpython3, but rather you typepyto run the "default" (defaults to latest version installed) or e.g. "py -3.7" to run an old version. And e.g. "py -m venv .venv" to source a virtual environment from your default Python.It's actually quite useful and is a first-party supported solution bundled with Python. It's very similar to
pyenvand the like.The downside is when trying to help newbies, you have to know all the intricacies of every platform, and know exactly how they installed their Python.
For example, the Windows Store now has multiple Python versions available for install. I haven't checked out this approach yet, so I don't know where they install to on the computer. I know other such "apps" install into gibberish folder names in a protected apps folder, perhaps the Python apps go to that senseless place as well.
But if you install Python via Windows Store, you invoke it by typing
pythonorpython3. But what if you have multiple 3.X versions installed that way? I don't know, as I haven't tried.And at least as of a year or so ago, the Windows Store would even intercept typing
pythonin an activated virtual environment (where such a command is a valid way to launch the venv Python). It would take you to the Windows Store to install Python the "new way".Python version management is a moving target on every platform, and if you hope to help friends and colleagues get into it, you need to know the intricacies of every one in order to just get them started.