1. using pip (for ubuntu: using "sudo apt-get install python3-pip" to install pip for python3):
pip install mudulename
2. using sudo command in Linux in condition that pip doesn‘t work, for example the Tkinter module:
sudo apt-get install python3-tk # for Python 3
sudo apt-get install python-tk # for python 2
Reason:
"you cannot install this library using pip, as pip is only designed to install pure python packages. By the way you would not have the sufficient rights to install the library. So you need to ask your superuser for help."
Reference Link:
1. https://packaging.python.org/en/latest/install_requirements_linux/#installing-pip-setuptools-wheel-with-linux-package-managers
2. http://askubuntu.com/questions/505141/unable-to-install-import-tkinter