Search code examples
pythonherokucelerygdbm

How can I install gdbm module on heroku?


I'm running a celery worker on heroku and when starting up the worker I always get an error:

 ImportError: No module named gdbm 

I've confirmed this by running python on heroku and trying to import gdbm:

$ heroku run python
Running `python` attached to terminal... up, run.1960
Python 2.7.8 (default, Jul  9 2014, 20:47:08) 
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdbm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gdbm
>>> exit()

How can I install this module on heroku? Do I need to add a particular package to requirements.txt? If so, what version?

Thanks for your help!


Solution

  • According to Heroku documentation it's not possible to use filesystem databases https://devcenter.heroku.com/articles/read-only-filesystem

    The following types of behaviors are not supported:

    • Caching pages in the public directory
    • Saving uploaded assets to local disk (e.g. with attachment_fu or - paperclip)
    • Writing full-text indexes with Ferret
    • Writing to a filesystem database like SQLite or GDBM
    • Accessing a git repo for an app like git-wiki