1. 程式人生 > >【linux】安裝gae時提示安裝python-gevent

【linux】安裝gae時提示安裝python-gevent

2013年1月5號:

       折騰了一天,GAE終於成功聯網,回顧一下整個安裝過程,貌似走了很多彎路,尤其是這篇博文,寫的很扯淡了。之前以為有WARNING,就無法使用,最後才發現,最新的GAE是不依賴python-gevent的,我只是人為的把問題想得過於複雜了。

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

根據網上搜到的教程安裝gae,在安裝的最後,執行

python proxy.py

卻提示
WARNING: python-gevent not installed. `curl -k -L http://git.io/I9B7RQ|sh`

根據提示執行
curl -k -L http://git.io/I9B7RQ|sh

提示
The program 'curl' is currently not installed. You can install it by typing:apt-get install curl

根據提示執行
apt-get install curl

安裝成功再執行
curl -k -L http://git.io/I9B7RQ|sh

又提示
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

根據在公司用FTP傳輸的經驗,可能curl傳輸的不是二進位制檔案,導致無法解壓縮,然而在網上搜索curl也沒用找到如何以二進位制傳輸,用man curl檢視,提示中也沒有講如何以二進位制傳輸。然後就想到手動下載,不用shell。

在firefox位址列輸入

http://git.io/I9B7RQ|sh
跳轉到頁面:
#!/bin/sh

curl -O https://github.com/downloads/SiteSupport/gevent/gevent-1.0rc2.tar.gz && tar xvzpf gevent-1.0rc2.tar.gz && cd gevent-1.0rc2 && sudo python setup.py install

第二行是一組命令組合,先下載gevent,解壓,然後安裝。但是問題又出來了
curl -O https://github.com/downloads/SiteSupport/gevent/gevent-1.0rc2.tar.gz
用上述命令下載的gevent檔案解壓是,依然提示
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

看來下載依然不是用二進位制傳輸的。ftp問題多多,但是平時上網用瀏覽器下載檔案根本不會遇到這種問題。靈機一動,是否可以直接用瀏覽器下載那。把

https://github.com/downloads/SiteSupport/gevent/gevent-1.0rc2.tar.gz
複製到瀏覽器位址列,彈出下載,儲存。進入下載目錄,順利解壓。看來問題的確處在傳輸上。

繼續進行,進入gevent目錄,執行

python setup.py install
,竟然又提示錯誤,此時只有滿腹只有一個詞,“我靠”,linux也太折騰人了。
gevent/gevent.core.c:5:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
網上搜了一下,是python的問題,下載python dev,問題解決
apt-get install python-dev

2012.12.29 gae沒有安裝成功