Similar to how we are using nodejs-n and rbenv, using pyenv to install python allows installing and managing different python versions easily.
Managing python and various versions has been a nightmare.
Are you saying we shouldn't use pyenv to discourage the practice of installing and managing different python versions?
No, just that I wish a simple solution existed. I am more than willing
to consider pyenv, I have not yet.
I gave it a test today, seems to work fine
sudo apt -t testing install -y \
git-core wget curl build-essential software-properties-common xz-utils \
libbz2-dev libffi-dev liblzma-dev libncurses5-dev libncursesw5-dev libreadline-dev libsqlite3-dev libssl1.0-dev llvm tk-dev zlib1g-dev
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
~/.pyenv/bin/pyenv install 3.7.1
~/.pyenv/bin/pyenv global 3.7.1
Then I successfully installed
~/.pyenv/bin/pyenv install 3.5.6
~/.pyenv/bin/pyenv install 3.4.9
~/.pyenv/bin/pyenv install 3.3.7
~/.pyenv/bin/pyenv install 3.2.6
~/.pyenv/bin/pyenv install 3.1.5
~/.pyenv/bin/pyenv install 2.7.15
~/.pyenv/bin/pyenv install 2.6.9
~/.pyenv/bin/pyenv install 2.5.6
~/.pyenv/bin/pyenv install 2.4.6
Wouldn't a better solution be using Anaconda? It does the work for you for managing different python environments.
does Anaconda let me install 4 separate versions of Python 3 and 2 versions of Python 2?
Their site doesn't seem to make that info easy to find: https://www.anaconda.com/download/
Yes. That is just the page to download from. You can download it through apt. Here's the link to the set-up guide: Ignore using Spyder IDE, VS Code is far superior and even has a link for using it on the bottom of the page. There are links on the left side for more detailed information about Anaconda. Having had to set it up on Windows, I did eventually run across a doc or forum that talked about having a virtual env set up in anaconda. I didn't take a closer look as I only need to use the latest available for a brand new project I'm doing.
Edit: Found it rather quickly from the FAQs. https://conda.io/docs/user-guide/tasks/manage-python.html
that's not exactly what I particularly look for, but if WLinux would like to ship Anaconda by default I won't object
Maybe we should give the user the option and link to a page describing the differences between the two so they can choose the best one for them.
We are looking at this as part of a new approach to managing dev environments.
Anaconda, even MiniConda, while I like them, is a heavyweight implementation. PyEnv seems more Linux friendly and so far we've had greater flexibility and fewer headaches.
An implementation of pyenv is now under testing
Issue in -development branch implementation, see https://gist.github.com/sirredbeard/38a9c3ebfd08214f3f3ff37a45be2fef
It's not showing up in PATH after the error above.
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program Files/WindowsApps/WhitewaterFoundryLtd.Co.16571368D6CFF_1.2.3.0_x64__fbkee70p8a0b6:/mnt/c/ProgramData/DockerDesktop/version-bin:/mnt/c/Program Files/Docker/Docker/Resources/bin:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS/:/mnt/c/WINDOWS/system32:/mnt/c/WINDOWS:/mnt/c/WINDOWS/System32/Wbem:/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/:/mnt/c/WINDOWS/System32/OpenSSH/:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/dotnet/:/mnt/c/Program Files/Microsoft SQL Server/130/Tools/Binn/:/mnt/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn/:/mnt/c/Program Files (x86)/Windows Kits/10/Windows Performance Toolkit/:/mnt/c/Users/Hayden/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/Hayden/AppData/Local/GitHubDesktop/bin:/mnt/c/Users/Hayden/.dotnet/tools:/mnt/c/Users/Hayden/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/Hayden/AppData/Local/Microsoft/WindowsApps
Re-launching bash fixes it.
As:
$ export PATH="/home/pengwin/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
I don't know why this doesn't work in the script because it works fine when stepping through manually.
Working fix + explanation here: https://github.com/WhitewaterFoundry/pengwin-setup/pull/151