Tested on Ubuntu 18.04 bionic [Ubuntu on Windows 10]
Because I often forget it, I wrote this reminder to myself.
This is how you install Python3.7.
It bothered me that i had to write python3.7
,
so I also mention here how to implement alias.
As far as I know, aliasses only work on unix-like systems.
# Python 3.7 on WSL
$ sudo apt update
$ sudo apt install software-properties-common
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt install python3.7
# Changing aliasses
$ vim .zshrc # or .bashrc if you are using bash
# inside .zshrc
alias python="python3.7"
alias pip="python3.7 -m pip"
# close vim with ESC, :wq, ENTER
# Check if everything is installed right
$ python -V
Python 3.7.4
$ pip -V
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.7)
virtualenv is a tool to create isolated Python environments. virtualenv creates a folder which contains all the necessary executables to use the packages that a Python project would need. And again, I will add an alias.
$ pip install virtualenv
# Changing aliasses
$ vim .zshrc # or .bashrc if you are using bash
# inside .zshrc
$ alias virtualenv="python -m virtualenv"
# close vim with ESC, :wq, ENTER
# Check installation
$ virtualenv --version
16.7.5