2

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 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
CharlesB
  • 86,532
  • 28
  • 194
  • 218
Ran
  • 21
  • 2
  • Related question (with a solution): http://stackoverflow.com/questions/5256397/python-easy-install-fails-with-assembler-for-architecture-ppc-not-installed-on/5283514#5283514 – Tamás Jun 16 '11 at 11:39

3 Answers3

4

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.

sjcockell
  • 161
  • 4
1

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.

Stefan Gruenwald
  • 2,582
  • 24
  • 30
0

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

Peter Cock
  • 1,585
  • 1
  • 9
  • 14