2011-06-07 363 views
2

im使用mac 10.6.7和xcode 4安裝gcc 4.2時遇到問題。 但是當我用安裝biopython: 蟒蛇的setup.py的命令安裝 ,它給出了錯誤的GCC:在安裝biopython軟件包

10-54-41-155-wireless1x:biopython-1.57 xueran2010$ python setup.py install 
running install 
running build 
running build_py 
running build_ext 
building 'Bio.cpairwise2' extension 
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -IBio -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c Bio/cpairwise2module.c -o build/temp.macosx-10.6-universal-2.6/Bio/cpairwise2module.o 
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler   (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed 
Installed assemblers are: 
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64 
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386 
Bio/cpairwise2module.c:639: fatal error: error writing to -: Broken pipe 
compilation terminated. 
lipo: can't open input file: /var/folders/ir/ir6RCJTKGB4QU5sVdTXwt++++TI/-Tmp-//cccUvTiF.out (No such file or directory) 
error: command 'gcc-4.2' failed with exit status 1 
+0

相關問題(與解決方案):http://stackoverflow.com/questions/5256397/python-easy-install-fails-with-assembler-for-architecture-ppc-not-installed-on/5283514 #5283514 – 2011-06-16 11:39:34

回答

4

我建議你的問題的根源在於這一行:

/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed 

的XCode 4不喜歡嘗試編譯事情與PPC架構,所以你需要停下來嘗試:

env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install 

(免責聲明:我無法測試這個,因爲BioPython在我的10.6.7機器上構建得很好......)

您可能從http://biostar.stackexchange.com以後的任何BioPython問題中獲得更多樂趣。

1

安裝biopython是使用Anaconda最簡單的方法。從Continuum網站下載最新版本(http://continuum.io/downloads),安裝軟件包,然後轉到終端並更新conda和anaconda(只是爲了安全起見,您擁有所有新軟件包)。那麼,這樣做:

conda update conda 
conda update anaconda 

那你就準備好與安裝biopython:

conda install biopython 

就是這樣。打開Anaconda並啓動一個IPython筆記本。要查看biopython作品是否做到以下幾點:

from Bio.Seq import Seq 
my_seq = Seq("AGTACACTGGT") 
my_seq 

如果你得到你的序列回來,這是工作。