Install packages

Install python packages (pip install)

Install pip package manager

# install pip on Ubuntu/Linux command line

sudo apt-get install python-pip

# get latest version of the pip package installer

python -m pip install --upgrade pip

Install package NumPy

# standard system-wide installation

python -m pip install numpy

# alternatively: install local user version

# doesn’t require root admin permissions

pip install --user numpy

# add to your .bashrc file (path to local installation)

export PATH="$PATH:/home/myUserName/.local/bin"

Get installed package version & location (Linux/Ubuntu command line)

pip show numpy

Name: numpy

Version: 1.13.3

Summary: NumPy: array processing for numbers, strings, records, and objects.

Home-page: http://www.numpy.org

Author: NumPy Developers

Author-email: numpy-discussion@python.org

License: BSD

Location: /usr/lib/python2.7/dist-packages

Get installed package version & location (within Python)

# start Python

python

# get package version

import numpy

print(numpy.__version__)

1.13.3

import matplotlib

print(matplotlib.__version__)

2.2.4

# get package location

from distutils.sysconfig import get_python_lib

print(get_python_lib())

/usr/lib/python2.7/dist-packages

https://docs.python.org/3/installing/index.html

https://packaging.pypa.io/en/latest/

http://www.scipy.org/install.html