python - 安装django后更改python版本

标签 python django mod-wsgi

我正在尝试安装 mod_wsgi 和 django。当我“make”mod_wsgi 时,如果我使用 python2.7,我会收到错误,但使用默认 python 就可以了。

我已经浪费了很多时间来解决这个问题,但无法解决它。

我只是想知道如果继续使用默认的 python 并安装 Django 那么我可以稍后将 python 更改为 2.7

编辑: CENTOS5.5 我得到的错误是

/usr/bin/ld: /opt/python27/lib/libpython2.7.a(node.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /opt/python27/lib/libpython2.7.a: could not read symbols: Bad value collect2: ld returned 1 exit status apxs:Error: Command failed with rc=65536 . make: * [mod_wsgi.la] Error 1

如果我这样做,这一切都会发生

"make" in mod_wsgi directory

现在这个错误写在他们的help site

但我无法配置这些东西。

根据他们的说法

If the version of Python being used was compiled for X86 64 bit architecture and a shared library does exist, but not in the 'config' directory, then adding the missing symlink may be all that is required.

我发现我的python版本是64位。所以唯一剩下的就是他在上面提到的另一个选项。

我不知道该怎么做

1) Check if shared library does exist
2) How to add the missing symlink

如果我使用默认 python 制作 mos_wsgi 那么我不会收到错误。

最佳答案

I just wanted to know that if continue with default python and install Django then can i change the python to 2.7 later

是的。允许升级。 AFAIK,没有法律规定您不得升级。确实,为什么要问是否可以升级?您是否被告知不允许升级?

使用默认的Python。

学习Python。完成整个教程。

安装 Django。

学习Django。完成整个教程。

当您安装 mod_wsgi 时(您不应该先这样做),请搜索 CentOS 和 mod_wsgi。搜索是一项重要技能。

Problem with Django setup using mod_wsgi and apache on centos 5.4

http://library.linode.com/frameworks/django-apache-mod-wsgi/centos-5

并且允许升级。不要请求许可。搜索相关问题。

关于python - 安装django后更改python版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6108474/

相关文章:

python - 相当于R中Python对字符串的综合列表操作

python数据结构(类似设置)在添加重复项时抛出异常

python - 尝试在 apache 上运行 werkzeug (wsgi 错误)

django - 在 django 的管理站点中为表单使用不同的时区

linux - 允许不同的用户使用 touch -m 修改 wsgi 文件的时间

python - 从不运行 Django 的站点使用 mod_wsgi 服务 Django 应用程序/

python - wxPython:手动调用事件

python - 使用 asyncio/aiohttp 获取多个 URL 并重试失败

python - 如何在Django中的表单验证中排除某些字段

django - 在Nginx中运行Django站点时尝试查找500错误的原因