im using mac 10.6.7, and xcode 4 with gcc 4.2 installed. but when i was installing biopython with: python setup.py install on the command, it gives开发者_JS百科 out error on gcc:
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
I would suggest the root of your problem is this line:
/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 doesn't like trying to compile things with the PPC architecture, so you need to stop it trying:
env ARCHFLAGS="-arch i386 -arch x86_64" python setup.py install
(DISCLAIMER: I can't test this, since BioPython builds just fine on my 10.6.7 machine...)
You might get more joy with any future BioPython questions from http://biostar.stackexchange.com.
Easiest way to install biopython is to use Anaconda. Download the newest version from the Continuum website (http://continuum.io/downloads), install the package then go to the terminal and update conda and anaconda (just to be on the safe side that you have all the new packages). So, do this:
conda update conda conda update anaconda
Then you are ready to install biopython with:
conda install biopython
That's it. Open Anaconda and start an IPython notebook. To see whether biopython works, do the following:
from Bio.Seq import Seq my_seq = Seq("AGTACACTGGT") my_seq
If you get your sequence back, it is working.
Seems to be a problem with Apple's new version of X Code, affecting other Python libraries like NumPy as well.
See this thread where a simple solution suggested is to uninstall X Code 4, install Xcode 3, and then optionally reinstall XCode 4.
http://lists.open-bio.org/pipermail/biopython/2011-June/007320.html
精彩评论