In the “How to Create a Python Module Package” article, I shared the information on how to create a Python Module Package. In this post, let’s jump into using GitHub Repo as a host to install the Python Package.
If you want to learn more Python, check out the books below at Amazon.
Table of Contents
Setting Up the GitHub Repo
Assuming you have the Python Package ready (Please refer to How to Create a Python Module Package for more details how to create a Python Package), you need to have GitHub Repo to host the installation of your Python Package.
Check out How to use GitHub Desktop to manage your code post to setup your GitHub account and Repo.
Creating GitHub Repo
Once you have your GitHub account, create a new Repo (or Repository) by clicking the New
.
Name the repository same as your Python Package name. Let’s use the Repository name techcookbook as the package name we used in the How to Create a Python Module Package post. I selected Public so you have access to this repo when you pip install
to this repo.
Clone the Repository Locally
Once the Repository is created, clone the online repository to your local machine. (See How to use GitHub Desktop to manage your code post)
Add all your related files and directory of the Python Package to the local repository.
Once it is added, commit and push those files to GitHub.com. (See How to use GitHub Desktop to manage your code)
Install Python Package from GitHub
By this time, you should have your Python Package up in the GitHub. Your GitHub repository should look something like below.
.git URL
pip install
from GitHub is pretty easy. You need to know the .git
path of your repository.
Click the Clone or download.
Make sure it is Clone with HTTPS
. Copy the web URL. In this case:
https://github.com/yfujieda/techcookbook.git
pip install Python Package from GitHub
To pip install from GitHub, you need to add git+
in front of https URL. The full command looks something like below:
pip install git+https://github.com/yfujieda/techcookbook.git
Latest Posts
- How to convert MD (markdown) file to PDF using Pandoc on macOS Ventura 13
- How to make MD (markdown) document
- How to Install Docker Desktop on mac M1 chip (Apple chip) macOS 12 Monterey
- How to install MySQL Workbench on macOS 12 Monterey mac M1 (2021)
- How to install MySQL Community Server on macOS 12 Monterey (2021)