gpt4 book ai didi

python - 枕头 : undefined symbol: PyCapsule_New

转载 作者:太空宇宙 更新时间:2023-11-03 17:17:31 25 4
gpt4 key购买 nike

我有这个先决条件:

  • CentOS 6.5
  • Python2.7 安装命令 ./configure
    --prefix=/usr/local --enable-unicode=ucs4;制作;进行安装;
  • httpd 作为 Django 网站的网络服务器

我得到这样的回溯:

...
File "/var/www/html/mysite.com/mylib/uploader/fields.py", line 8, in <module>
from PIL import Image
File "/var/www/html/mysite.com/eggs/Pillow-2.4.0-py2.7-linux-x86_64.egg/PIL/Image.py", line 53, in <module>
File "/var/www/html/mysite.com/eggs/Pillow-2.4.0-py2.7-linux-x86_64.egg/PIL/_imaging.py", line 7, in <module>
File "/var/www/html/mysite.com/eggs/Pillow-2.4.0-py2.7-linux-x86_64.egg/PIL/_imaging.py", line 6, in __bootstrap__
ImportError: /tmp/python-eggs/Pillow-2.4.0-py2.7-linux-x86_64.egg-tmp/PIL/_imaging.so: undefined symbol: PyCapsule_New

当我尝试从 Django shell 执行 from PIL import Image 时 - 它顺利通过了。

谷歌搜索这个错误对我帮助不大,请帮忙。

更新:
我尝试使用 Djangos 内部服务器(manage.py runserver 命令)为该网站提供服务,它工作正常。

最佳答案

我有一个类似的错误。

发生的事情是我的 python2.7 安装正在从系统 python2.6 中获取包(通过一些 PYTHONPATH muckery)

要进行调试,请在导入的内容之前放置一个断点,然后:

import sys
for path in sys.path:
print(path)

理想情况下它应该只包含 python2.7 的东西,但你可能已经将 python2.6 的东西泄露到它上面(或者相反)

关于python - 枕头 : undefined symbol: PyCapsule_New,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22970108/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com