- Set global and per-project python versions
- Not written in Python.
- Shims your PATH
- Linux, Mac, Windows
- Set global and per-project python versions
- Not written in Python.
- Shims your PATH
- Linux, Mac, Windows
git clone https://github.com/pyenv/pyenv.git
cd pyenv/plugins/python-build/bin
./python-build --definitions
./python-build 3.10.8 /opt/python/3.10.8
PYTHON_CONFIGURE_OPTS="--enable-shared" ./python-build 3.10.8 /opt/python/3.10.8I don't only use Win but I do use windows, so having to use different tooling makes pyenv a hard to swallow pill
Yeah “pyenv install 3.10.8” is basically rocket surgery, near impossible to learn.
$ pyenv install 3.11-dev (or use pyenv install --list to show list all available versions to install)
Use it in your current shell: $ pyenv shell 3.11-dev
Use it in the project directory: $ pyenv local 3.11-dev
Use it as the global default: $ pyenv global 3.11-dev
All of the mentioned commands can be called with no arguments to show the current python version for the context.There you go, now you know pyenv. Call it with no arguments to show the other possible commands.
Hell, the fork could have used Go or whatever too but it went with a bunch of .bat scripts.
Which is to say, no pyenv is not an option for everyone.
Conda seems to be the most prone to getting in weird states or just hanging while "Solving environment." I have been happier leaving it behind.
Really the only two I would even consider using now are pyenv and poetry.
The other thing about Conda is that it doesn't cover just Python and Python packages, but all kinds of software that may be directly or indirectly relevant. For example, on Windows, there are Conda packages for the Windows SDK, and for various C++ compilers.
Once you're used to the workflow it's pretty smooth. (We switched from conda 2 years ago)
Does that mean I can do things like install black and jupyter once and use that install across projects?