So get PYTHONUTF8 added to the environment activate script. That's a
simple change to venv. And virtualenv, and conda
That's probably a good solution for venv and virtualenv -- essentially add it as another environment creation option.
but conda, not so much. Conda can manage everything, not just python. YOU can create an conda environment with no Python at all in it. So UTF-8 mode is not really a configuration of the environment itself, but rather a configuration of the Python package. It's also the philosophy of conda that it essentially installs stuff built in the usual way -- conda-build is pretty stupid actually. GRanted, it does indeed have a lot of special case stuff for Python, so this probably could be done, but I'd rather see this kind of Python configuration done in a more friendly manner to third party package managers (anyone know anything about chocolaty, for instance?)
NOTE: I use conda a lot, but DO NOT know all it's ins and outs -- it may be possible to set environment variables with a package install -- given that the word "environment" shows up all over the place in conda docs, Google has not helped me answer that question.
a change to Python's already complex (and slower than many of us would
like) startup process.
That IS a real issue, yes :-(
And anyway, would you not have to explain how to set UTF-8 mode for
the training environment one way or another anyway?
That's why I'd like "one way to do it" on all platforms -- see other parts of this thread.
Christopher Barker, PhD (Chris)
Python Language Consulting
- Scientific Software Development
- Desktop GUI and Web Development
- wxPython, numpy, scipy, Cython