2011-05-24 139 views
1

我试图安装mod_wsgi和django。当我“make”mod_wsgi然后我得到错误,如果我使用python2.7,但它与默认的python确定。安装django后更改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

这一切heppens如果我做

"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然后我没有得到任何错误。

+0

你最好粘贴你的错误日志,其他人可以帮你弄清楚如何处理它。一般来说,Django(> 1.2)在python 2.7中运行良好。 – 2011-05-24 09:44:06

+0

并告诉我们你的服务器操作系统及其版本是什么! – MBarsi 2011-05-24 09:58:05

+0

如果您刚刚开始使用Django,则不应该使用mod_wsgi。做这个教程,使用内置的runserver,然后在需要部署的时候担心mod_wsgi。 – 2011-05-24 10:03:53

回答

1

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

和升级是允许的。不要求许可。搜索相关问题。

+0

感谢哥们我会这样做。我已经完成了学习Python的第一步,现在我将去Django。感谢您的指导 – user2134226 2011-05-24 10:23:17

+0

学习Python不是24小时内可以完成的任务,我想。 – 2011-05-24 14:21:22