Question

I am trying to install numpy so that i can install biopython after that. I have pyton 2.7 already installed and when i type python on my command prompt, i get the following:

python
Python 2.7.4 (v2.7.4:026ee0057e2d, Apr  6 2013, 10:15:50) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

So i do have the C compiler. Now when i download the .tar of numpy and tdo the following steps:

> tar -xzvpf numpy-1.5.1.tar.gz
> cd numpy-1.5.1/
> python setup.py build

I get the follwing error:

Traceback (most recent call last):
  File "setupegg.py", line 17, in <module>
    from setuptools import setup
ImportError: No module named setuptools
maziz1-ml:numpy-1.5.1 maziz$ sudo python setupegg.py
Traceback (most recent call last):
  File "setupegg.py", line 17, in <module>
    from setuptools import setup
ImportError: No module named setuptools
maziz1-ml:numpy-1.5.1 maziz$ sudo python setup.py install
Running from numpy source directory.non-existing path in 'numpy/distutils': 'site.cfg'
F2PY Version 1
blas_opt_info:
  FOUND:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3)]
    extra_compile_args = ['-faltivec', '-I/System/Library/Frameworks/vecLib.framework/Headers']

lapack_opt_info:
  FOUND:
    extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
    define_macros = [('NO_ATLAS_INFO', 3)]
    extra_compile_args = ['-faltivec']

running install
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building py_modules sources
building library "npymath" sources
customize NAGFCompiler
Could not locate executable f95
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize Gnu95FCompiler
Could not locate executable gfortran
customize G95FCompiler
Could not locate executable g95
don't know how to compile Fortran code on platform 'posix'
C compiler: /usr/bin/clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -g -O2 -DNDEBUG -g -O3

compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
clang: _configtest.c
/usr/bin/clang _configtest.o -o _configtest
ld: warning: ignoring file _configtest.o, file was built for i386 which is not the architecture being linked (x86_64): _configtest.o
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: ignoring file _configtest.o, file was built for i386 which is not the architecture being linked (x86_64): _configtest.o
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
  File "setup.py", line 211, in <module>
    setup_package()
  File "setup.py", line 204, in setup_package
    configuration=configuration )
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/core.py", line 186, in setup
    return old_setup(**new_attr)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/install.py", line 55, in run
    r = old_install.run(self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 563, in run
    self.run_command('build')
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/build.py", line 37, in run
    old_build.run(self)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build.py", line 127, in run
    self.run_command(cmd_name)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 326, in run_command
    self.distribution.run_command(command)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/build_src.py", line 152, in run
    self.build_sources()
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/build_src.py", line 163, in build_sources
    self.build_library_sources(*libname_info)
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/build_src.py", line 298, in build_library_sources
    sources = self.generate_sources(sources, (lib_name, build_info))
  File "/Library/Python/2.7/site-packages/numpy-1.5.1/numpy/distutils/command/build_src.py", line 385, in generate_sources
    source = func(extension, build_dir)
  File "numpy/core/setup.py", line 683, in get_mathlib_info
    raise RuntimeError("Broken toolchain: cannot link a simple C program")

any ideas what is going on? Thanks

Was it helpful?

Solution 2

It looks like you're missing a fortran compiler and setuptools. Did you install the developers tools (Xcode or the stand-alone command line tools)? For setuptools, there are tons of similar answers already posted. Just google the error message.

That said, I would recommend possibly looking at the Continuum Anaconda distribution to just get the majority of the python scientific stack through a simple installer:

https://store.continuum.io/cshop/anaconda/

It comes with biopython included and is free. Alternatively there is the Enthought Python Distribution that also included biopython:

https://enthought.com/products/epd/package-index/

OTHER TIPS

this was my solution, Go to: sourceforge get the latest version which matched my python 2.7 and simply installed. Thanks

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top