0

We have a rails app running on the Heroku Cedar stack, and we have a need for an external python module, namely 'pyPdf'. Unfortunately it is not one of the pre-installed python modules.

Is there a way to install python modules on the Cedar stack? I've tried to add a requirements.txt at the root of my app, but this doesn't seem to work. Probably because Heroku dismisses it after seeing our Gemfile.

Any help appreciated.

Bastien
  • 481
  • 4
  • 16

1 Answers1

1

Is this module something that you're trying to access from your Rails application? If so, you can always access bash on a dyno to download and compile a library (if compilation is needed) and then stuff the resultant file into your application codebase (somewhere like /app/bin). Then you can refer to this binary in your code.

To access bash on a dyno:

heroku run bash --app your_app_name

An example of the above:

http://theprogrammingbutler.com/blog/archives/2011/07/28/running-pdftotext-on-heroku/

Note, you won't be able to install anything into a dyno because the dynos change on an ad-hoc basis and you'll never know what state your in. Also note that the moment you exit from bash that dyno is killed, so don't leave anything laying around - it'll get vaporised.

Neil Middleton
  • 22,105
  • 18
  • 80
  • 134
  • I tried to install this python module, https://github.com/clips/pattern, on heroku from my rails app, however i got this error, `error: could not create '/usr/local/lib/python2.7/site-packages/pattern': Read-only file system.` Do you have any idea? – Chamnap Mar 28 '13 at 17:30