首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装pylibmc时出现Heroku/Django错误

安装pylibmc时出现Heroku/Django错误
EN

Stack Overflow用户
提问于 2013-02-04 22:27:26
回答 1查看 661关注 0票数 4

当我试图部署到Heroku时,我得到了一长串的错误。我跟随他们的指南开始,但显然它是缺乏的和不准确的。

我的设置是一个模块,我的要求是为每个环境创建一个包含不同.txt文件的文件夹:

代码语言:javascript
复制
settings/
  base.py
  dev.py
  heroku.py

requirements/
  base.txt
  dev.txt
  heroku.txt

我尝试在base.txt和heroku.txt (扩展base.txt)中使用pylibmc==1.2.2 django-pylibmc-sasl==0.2.4部署到Heroku,但仍然是一样的。

Bug跟踪(小样本):

代码语言:javascript
复制
_pylibmcmodule.c:2097: warning: passing argument 1 of ‘PyInt_FromLong’ makes integer from pointer without a cast

       /app/.heroku/python/include/python2.7/intobject.h:38: note: expected ‘long int’ but argument is of type ‘struct PylibMC_Behavior *’

       _pylibmcmodule.c:2097: warning: passing argument 1 of ‘PyObject_SetAttrString’ from incompatible pointer type

       /app/.heroku/python/include/python2.7/object.h:472: note: expected ‘struct PyObject *’ but argument is of type ‘struct PylibMC_Behavior *’

       _pylibmcmodule.c:2098: error: ‘PylibMC_McErr’ has no member named ‘name’

       _pylibmcmodule.c:2098: error: ‘PylibMC_McErr’ has no member named ‘exc’

       _pylibmcmodule.c:2098: warning: passing argument 2 of ‘PyModule_AddObject’ from incompatible pointer type

       /app/.heroku/python/include/python2.7/modsupport.h:40: note: expected ‘const char *’ but argument is of type ‘struct PylibMC_Behavior *’

       _pylibmcmodule.c:2100: error: ‘PylibMC_McErr’ has no member named ‘name’

       _pylibmcmodule.c:2100: error: ‘PylibMC_McErr’ has no member named ‘exc’

       _pylibmcmodule.c: In function ‘init_pylibmc’:

       _pylibmcmodule.c:2176: error: ‘LIBMEMCACHED_VERSION_STRING’ undeclared (first use in this function)

       _pylibmcmodule.c:2176: warning: passing argument 3 of ‘PyModule_AddStringConstant’ from incompatible pointer type

       /app/.heroku/python/include/python2.7/modsupport.h:42: note: expected ‘const char *’ but argument is of type ‘struct PylibMC_Behavior *’

       error: command 'gcc' failed with exit status 1

       ----------------------------------------
       Command /app/.heroku/python/bin/python -c "import setuptools;__file__='/app/build/pylibmc/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-i0GDaz-record/install-record.txt failed with error code 1 in /app/build/pylibmc
       Storing complete log in /app/.pip/pip.log
 !     Heroku push rejected, failed to compile Python app

我找到了与this相关的帖子,这给了我一个想法,试图将库添加到base.txt中,但仍然没有帮助。

EN

回答 1

Stack Overflow用户

发布于 2013-02-07 19:39:46

如果requirements.txt中存在Pylibmc,则会自动支持Pylibmc。

拥有所有这些需求文件只会带来额外的开销。请查看Twelve-Factor's Dev/Prod Parity文章。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14688799

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档