Search code examples
pythonherokumashape

Is is possible to use non-pip-installable modules on Heroku?


I really want to use the Mashape python module in an app I have on Heroku. https://github.com/Mashape/mashape-python-client-library

However I've tried pip install mashape but I can't install it that way so I can't put it in my pip requirements.txt for Heroku to install when I deploy my application.

Is there another way around this? And in general is there a way for a Heroku app to use python modules that aren't installable via pip (like build from source instead)?


Solution

  • There are probably two ways for you to use mashape.

    The first is to include mashape as part of your project and make sure that the mashape directory is in the python path in your project directory. In this way, you can import mashape as usual.

    The second way is to fork mashape and write a simple setup.py file for mashape in your own fork. And then, without needing to uploading mashape into pypi, you can still install it using the setup.py you wrote and pushed up into your own forked github repo, via pip using something like:

    `pip install -e git+git://github.com/YourFork/mashape-python-client-library.git#egg=mashape`
    

    where YourFork is your github user id.