python - 重新构建 Python 和 mod_wsgi

标签 python django python-2.7 rhel

我遇到了一个问题,我在这里描述了 mod_wsgi Apache error with django app

最后我到了需要重建 mod_wsgi 的地步。

服务器是 RHEL 6,因此默认安装了 python 2.6,为了运行一些东西,另一个管理员另外安装了 python 2.7

现在我遇到了这个问题

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

根据https://code.google.com/p/modwsgi/wiki/InstallationIssues我遇到的问题是编译为 32 位的 python 和 mod_wsgi 为 64 位的冲突

遵循本指南 https://www.fir3net.com/Programming/Python/how-do-i-compile-modwgsi-for-python-27.html (和其他人)我正在尝试使用 --enabled-shared 重建 Python2.7 ,但是当我运行 make 时遇到相同的错误

/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

Python build finished, but the necessary bits to build these modules were not found:
bsddb185           dl                 imageop         

不知道是不是之前安装的python 2.7的问题。有一种安全的方法可以删除整个 python 2.7 以前的安装吗?我不知道这是否可以解决问题。

最佳答案

最后删除了/usr/local/lib 内容并重建 python 和 mod_wsgi

关于python - 重新构建 Python 和 mod_wsgi,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28681398/

相关文章:

python - 使用 python/bcrypt 将密码保存为用户集合中的 mongodb 中的加盐哈希

python - 使用函数作为具有 Enthought Traits 的实例方法 (Python)

python - 使用 ctypes 返回值

python-2.7 - 如何从 Github 导入 Xgboost 包到 Windows 7 上的 python 2.7?

python - 如何在 Raspberry Pi 上添加缺少的 PyQt5 模块

python - 修改矩阵行和列的每两个最大元素

django - 真正有效的 Django 搜索引擎解决方案?

python - 按 'datetime' 对列表进行排序

python - 如何在云中为 python 覆盖 GOOGLE_APPLICATION_CREDENTIALS

google-app-engine - Google App Engine 中的图像响应