How can I include a library from github in a python project without pip?

I'm not sure if the python way is to include another library obtained from github.

I am planning to use this library https://github.com/nim901/gfycat which right now I just downloaded zip

and pulled it and put it in lib

. I have to check out this library in the repo in order to work on Heroku. Is there a way to install lib automatically from github?

+3


source to share


3 answers


Heroku supports git-backed python dependencies via pip: https://devcenter.heroku.com/articles/python-pip#git-backed-distributions

I believe this suits your requirements better than checking the actual libraries on git. From the link above:



Anything that works with the standard application requirements file will work as expected on Heroku.

With pips Git support, you can install a Python package hosted in a remote Git repository.

For example:

git+git://github.com/kennethreitz/requests.git

+1


source


You can add the library as a submodule of your project. This will allow you to update it like any other git repository.



Is git clone https://github.com/nim901/gfycat.git

and then git pull

automatic enough? If this solution works for you and you need additional instructions, I'll add them.

+1


source


From the way I read your question, it looks like you are trying to install a module on your system in order to be able to import it into projects, etc.

Download the zip, extract it anywhere and open a terminal window to the same directory. Then just run python setup.py install

from directory and it should be installed in your system directory site-packages

for python.

I would recommend that you install it in your own managed environment virtualenv

( https://virtualenv.pypa.io/en/latest/ ), but this is not required.

0


source







All Articles