1. make sure the following was installed
sudo apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git
2. Install pyenv
sudo apt install pyenv
or
curl https://pyenv.run | bash
or
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
3. pyenv commands:
pyenv versionspyenv install -v 3.7.9pyenv global 3.7.9
4. pipenv
pipenv --python 3.7.9pipenv install <package>pipenv shell
python --version
5. update setuptools in pipenv. without this, wsl environment often raise error.
pip install -U setuptools