4

I'm not sure what's the python way to include another library getting from github.

I'm planning to use this library https://github.com/nim901/gfycat which right now I just downloaded the zip and extract it and put that in lib folder. I have to checkin this library into the repo to work in Heroku. Is there a way to install the lib automatically from github?

2
  • If you're using Heroku...why can't you just define a git-backed pip requirement? devcenter.heroku.com/articles/… Commented May 28, 2015 at 6:30
  • @rnevius heh, this looks like a much easier solution. Commented May 28, 2015 at 6:33

3 Answers 3

1

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

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

Anything that works with a standard pip requirements file will work as expected on Heroku.

Thanks to pip’s Git support, you can install a Python package that is hosted on a remote Git repository.

For example:

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

Sign up to request clarification or add additional context in comments.

Comments

1

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 fits you and you need additional instructions, I will add them.

Comments

0

From how I'm reading your question, it sounds like you're trying to install the module to your system in order to be able to import it into projects and such.

Download the zip, extract it to wherever, and open up a terminal window to the same directory. Then just run python setup.py install from within the directory, and it should install into your system-wide site-packages directory for python.

I would have to recommend that you install it into it's own environment managed by virtualenv (https://virtualenv.pypa.io/en/latest/), but it's not necessary.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.