Download Python from https://www.python.org/downloads/ ... and remember to select the option "Add Python to PATH
".
Install Homebrew and run
brew install python3
Run
sudo apt-get update && sudo apt-get install python3
Run
sudo pacman -Sy && sudo pacman -S python
pip
: installing Python packagespip
is a command-line tool for accesing to PyPI - the standard Python's packages repository.
pip install freegames # System- or environment-wide installation (see below)
pip install --user freegames # Local installation (see $PYTHONUSERBASE, if set)
pip install Pillow==5.1.0 # Installing a version of a package
pip install numpy>=0.2 # Installing a version higher or equal to
pip install pandas<0.4 # Installing a version smaller than
pip install cv2>=0.2,<0.3 # Using a range of versions
pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
A virtual environment is "a self-contained directory tree that contains a Python installation for a particular version of Python, plus a number of additional packages". This is useful when, for example, two or more Python projects that run in the same host require different configuration of Python and packages versions.
venv
pyenv
Useful to install and use different versions of Python which are independent of the system's installed Python.
(Replace .bashrc by .bash_profile in OSX)
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
See Common build problems if you are unable to install an environment.
Moreover, in order to have tkinter
graphical interface avaiable, the tk-dev
Linux package should have been installed.
sudo apt-get install tk-dev
TODO
pacman -S gcc make
pyenv install 3.6.4