Follow this guide to install WSL:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
-
Get your build tools and python required libraries installed:
sudo apt update && sudo apt install -y build-essential git libexpat1-dev libssl-dev zlib1g-dev \ libncurses5-dev libbz2-dev liblzma-dev \ libsqlite3-dev libffi-dev tcl-dev linux-headers-generic libgdbm-dev \ libreadline-dev tk tk-dev
-
Install pyenv (which will install python):
curl https://pyenv.run | bash
-
After install, it tells you to add the following to your
~/.bashrc
file, go do that:# Load pyenv automatically by adding # the following to ~/.bashrc: export PATH="/home/{USERNAME}/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)"
-
Install the latest 'common' versions of python through pyenv:
# list available python versions # pyenv install --list pyenv install 3.6.8 pyenv install 3.7.2
-
Install/Upgrade base libraries into both versions of python:
pyenv global 3.6.8 pip install pip --upgrade pip install pipenv pyenv global 3.7.2 pip install pip --upgrade pip install pipenv
-- Go to work!
I already install pyenv on wsl and create new env using
pyenv virtualenv 3.7.4 env-name.
After that i
pyenv activate env-name
pip install notebook
jupyter-notebook
access notebook. but it says i should apt-install jupyter notebook (basically no jupyter notebook). Even type
python
doesn't launch python. if i typepython3
i got python version 3.8.10 (which is i didn't voluntarily install).if i check
pyenv which python
it shows /home/User/.pyenv/versions/env-name/bin/pythonAnyone have a guide how to use pyenv on wsl?