Using "pip" with Different Sources

This section provides a tutorial example on how to use 'pip' to install Python packages from GitHub, local ZIP file or local directory.

If you are not able to install a Python package from the default repository, you can command "pip" to install it from different sources as shown below.

1. Install a package from GitHub.

herong$ pip install git+https://github.com/bp-kelley/descriptastorus
Collecting git+https://github.com/bp-kelley/descriptastorus
  Cloning https://github.com/bp-kelley/descriptastorus to /tmp/pip-...
  Running command git clone -q https://github.com/bp-kelley/descrip...
  Resolved https://github.com/bp-kelley/descriptastorus to commit 1...
  ...

2. Install a specific version of a package from GitHub.

herong$ pip install git+https://github.com/requests/requests@v2.15.0
  ...

3. Install a package from a ZIP file, which has a "setup.py" file.

herong$ pip install zip_file_path
  ...

4. Install a package from a directory, which has a "setup.py" file.

herong$ pip install dir_path
  ...

Table of Contents

 About This Book

 Running Python Code Online

 Python on macOS Computers

 Python on Linux Computers

 Built-in Data Types

 Variables, Operations and Expressions

 Statements - Execution Units

 Function Statement and Function Call

 Iterators and Generators

 List, Set and Dictionary Comprehensions

 Classes and Instances

 Modules and Module Files

 Packages and Package Directories

 "sys" and "os" Modules

 "pathlib" - Object-Oriented Filesystem Paths

"pip" - Package Installer for Python

 What Is "pip/pip2/pip3" Command

 Use "pip" Package in Python Script

 Install MySQL Connector/Python with "pip"

Using "pip" with Different Sources

 Commonly Used Python Packages/Libraries

 SciPy.org - Python Libraries for Science

 pandas - Data Analysis and Manipulation

 Anaconda - Python Environment Manager

 Jupyter Notebook and JupyterLab

 References

 Full Version in PDF/EPUB