2011-05-24 141 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