简体   繁体   中英

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!

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 (eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM