How to install a program from GitHub?
I am very new to GitHub. Recently I downloaded a program for printing in Sublime Text from GitHub. Here is the link: https://github.com/svenax/SublimePrint But after I downloaded the program called SublimePrint-master.zip, I don’t know how to install it in windows. It doesn’t look like there is a setup file or installation file after I unzipped SublimePrint-master.zip. Would anyone give me a hint how to install a program from GitHub? Many thanks.
6,478 7 7 gold badges 54 54 silver badges 95 95 bronze badges
asked Mar 28, 2018 at 2:00
207 1 1 gold badge 3 3 silver badges 10 10 bronze badges
Look for a readme (well-behaved projects should provide one). There’s not a universal way to install packages.
Mar 28, 2018 at 2:04
2 Answers 2
GitHub is not a store app. There is no “guide on how to install an a program from github”. Github is a platform where developers put their code*. Any code. It could be a Windows program. It could be an Android program. It could be html. It could be a library. It could be a snippet of code. It could be code in a language invented by the developer. It could be his shopping list.
Some repositories have a Readme that guides how to compile or install the program. But that is just up to the developers that posted the code. If there isn’t a readme then try to figure out what kind of code it is (e.g. a Sublime plugin) and search the web how to install that kind of code.
(*) it’s more than that, but for the purposes of the question let’s limit to this
answered Mar 28, 2018 at 2:06
72.4k 15 15 gold badges 145 145 silver badges 226 226 bronze badges
See this answer for how to install Sublime plugins: https://stackoverflow.com/a/15652795/4494
The plugin also contains a file INSTALL.txt , which should be a good start to read about, well, installing it: https://github.com/svenax/SublimePrint/blob/master/INSTALL.txt
answered Mar 28, 2018 at 2:04
Matthias Winkelmann Matthias Winkelmann
15.9k 7 7 gold badges 65 65 silver badges 76 76 bronze badges
- github
- sublimetext3
- sublimetext2
- sublime-text-plugin
-
The Overflow Blog
sponsored post
Linked
Related
Hot Network Questions
Subscribe to RSS
Question feed
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.9.21.43637
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.
Install Python Package from Github [Linux and Windows]
This article is about how to install python package from GitHub, for this, you must have the latest version of python installed in your system.
How to check if python is installed or not?
Before getting into the procedure of how to install python package from GitHub the latest python version installed is a must. So to check if your system has python go to the command prompt and type
python -version
This will be the output if the version is installed
But if it is not installed, python not found will be displayed on the command prompt.
Install Python Package from Github on Windows
How to install a python package using pip install?
Usually, in python, a package is installed using the command
pip install packageName
But sometimes, if a newer version of the library of the package is available, it might not get installed using this command, for that, we will learn how to download and install python package from Github.
Install Python Package from Github in VSCode
First of all, go to Github, and search for the package that you need to install. You need to make sure that the package has a “ setup.py ” file, for example in our case if we want to install the flask package from GitHub, I will search for the flask python package, and then check if it has the file “ setup.py ”.
After making sure that there is a setup file, go to your VS Code, in case you do not have VS Code, you can download it and set up a virtual environment.
Advertisement
The command to set up the virtual environment is :
python -m venv environmentName
After setting up the environment, go to your source using the following command
source environmentName/bin/activate
And then write the following command to install the package using GitHub
pip install -e git+github-url-of-the-package#egg=packageName
In my case, if I want to download the flask package I will write
Install a Python Package from Github Using Windows Command Prompt
This method is simpler, just open the windows command prompt to install python package from GitHub and write the following command
pip install -e git+github-url-of-the-package#egg=packageName
In my case, if I want to download the flask package I will write
The command prompt will show some output and will notify if the package is installed or not.
If successful, the following output will be shown :
Obtaining flask from git+https://github.com/pallets/flask#egg=flask Cloning https://github.com/pallets/flask to c:\users\azka\desktop\python\src\flask Running command git clone --filter=blob:none --quiet https://github.com/pallets/flask 'C:\Users\Azka\Desktop\python\src\flask' Resolved https://github.com/pallets/flask to commit 9b44bf2818d8e3cde422ad7f43fb33dfc6737289 Preparing metadata (setup.py) . done Requirement already satisfied: Werkzeug>=2.0 in c:\users\azka\appdata\local\programs\python\python310\lib\site-packages (from flask) (2.1.2)Requirement already satisfied: Jinja2>=3.0 in c:\users\azka\appdata\roaming\python\python310\site-packages (from flask) (3.0.3) Requirement already satisfied: itsdangerous>=2.0 in c:\users\azka\appdata\local\programs\python\python310\lib\site-packages (from flask) (2.1.2) Requirement already satisfied: click>=8.0 in c:\users\azka\appdata\local\programs\python\python310\lib\site-packages (from flask) (8.1.3) Requirement already satisfied: colorama in c:\users\azka\appdata\roaming\python\python310\site-packages (from click>=8.0->flask) (0.4.4) Requirement already satisfied: MarkupSafe>=2.0 in c:\users\azka\appdata\roaming\python\python310\site-packages (from Jinja2>=3.0->flask) (2.1.0) Installing collected packages: flask Running setup.py develop for flask Successfully installed flask
Install Python Package from GitHub on Linux
Install git on Linux (pre-requisite)
To install python package from Github on Linux you need to have git installed on your system. for that please type the following command on your Linux terminal.
sudo apt install git
The following output will be shown :
Reading package lists. Done Building dependency tree Reading state information. Done git is already the newest version (1:2.25.1-1ubuntu3.4). git set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 13 not upgraded.
Install python package on Linux using pip
Let’s suppose we want to install a package “moviespy” from GitHub, go to the Linux terminal and type the following command:
pip install git+https://github.com/Zulko/moviepy
The following output will be shown
Successfully installed decorator-5.1.1 imageio-2.19.3 imageio-ffmpeg-0.4.7 moviepy-2.0.0.dev2 numpy-1.23.0 pillow-9.2.0 proglog-0.1.10 tqdm-4.64.0
Install Python Package from Github by cloning the git repository
Another way to install Python Package from Github by cloning the git repository, for this process write the following commands
$ git clone link-to-github-repository
$ git clone https://github.com/Zulko/moviepy
the output will be as follows
Cloning into 'moviepy'. remote: Enumerating objects: 8208, done. remote: Counting objects: 100% (44/44), done. remote: Compressing objects: 100% (38/38), done. remote: Total 8208 (delta 20), reused 19 (delta 6), pack-reused 8164 Receiving objects: 100% (8208/8208), 40.60 MiB | 1017.00 KiB/s, done. Resolving deltas: 100% (5776/5776), done. Updating files: 100% (255/255), done.
Then move to the project directory using the cd command
$ cd moviepy
Run the setup.py file to install the package
$ sudo python setup.py install
Conclusion
In this article we have studied how to install a package from python using GitHub, we have studied installation in two environments, one is the virtual environment created using vs code and one is using the windows command prompt.
Further study
Didn’t find what you were looking for? Perform a quick search across GoLinuxCloud
If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.
For any other feedbacks or questions you can either use the comments section or contact me form.
Thank You for your support!!
Leave a Comment Cancel reply
Python Tutorial
- Python Multiline Comments
- Python Line Continuation
- Python Data Types
- Python Numbers
- Python List
- Python Tuple
- Python Set
- Python Dictionary
- Python Nested Dictionary
- Python List Comprehension
- Python List vs Set vs Tuple vs Dictionary
- Python if else
- Python for loop
- Python while loop
- Python try except
- Python switch case
- Python Ternary Operator
- Python pass statement
- Python break statement
- Python continue statement
- Python pass Vs break Vs continue statement
- Python function
- Python call function
- Python argparse
- Python *args and **kwargs
- Python lambda function
- Python Anonymous Function
- Python optional arguments
- Python return multiple values
- Python print variable
- Python global variable
- Python copy
- Python counter
- Python datetime
- Python logging
- Python requests
- Python struct
- Python subprocess
- Python pwd
- Python UUID
- Python read CSV
- Python write to file
- Python delete file
- Python any() function
- Python casefold() function
- Python ceil() function
- Python enumerate() function
- Python filter() function
- Python floor() function
- Python len() function
- Python input() function
- Python map() function
- Python pop() function
- Python pow() function
- Python range() function
- Python reversed() function
- Python round() function
- Python sort() function
- Python strip() function
- Python super() function
- Python zip function
- Python class method
- Python os.path.join() method
- Python set.add() method
- Python set.intersection() method
- Python set.difference() method
- Python string.startswith() method
- Python static method
- Python writelines() method
- Python exit() method
- Python list.extend() method
- Python append() vs extend() in list
- Create your first Python Web App
- Flask Templates with Jinja2
- Flask with Gunicorn and Nginx
- Flask SQLAlchemy
При подготовке материала использовались источники:
https://stackoverflow.com/questions/49524921/how-to-install-a-program-from-github
https://www.golinuxcloud.com/install-python-package-from-github/