简体   繁体   English

如何在heroku上安装gdbm模块?

[英]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: 我在heroku上运行一个芹菜工人,启动该工人时总是出现错误:

 ImportError: No module named gdbm 

I've confirmed this by running python on heroku and trying to import gdbm: 我已经通过在heroku上运行python并尝试导入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? 如何在heroku上安装此模块? Do I need to add a particular package to requirements.txt ? 我是否需要将特定的软件包添加到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 根据Heroku文档,不可能使用文件系统数据库 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) 将上传的资产保存到本地磁盘(例如,使用attachment_fu或-回形针)
  • Writing full-text indexes with Ferret 用雪貂编写全文索引
  • Writing to a filesystem database like SQLite or GDBM 写入文件系统数据库,例如SQLite或GDBM
  • Accessing a git repo for an app like git-wiki 访问像git-wiki这样的应用程序的git repo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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