2010-07-04 5 views
4

J'ai beaucoup de problèmes pour installer numpy sur Mac OS X 10.6. Lorsque je tente de l'installer à partir de la source, je reçois l'erreur suivante:erreur lors de l'installation de numpy sur Mac OS X 10.6

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 
Found executable /usr/bin/gfortran 
/Users/Software/numpy/numpy/distutils/fcompiler/gnu.py:126: UserWarning: Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3 
    warnings.warn(s) 
customize Gnu95FCompiler 
customize Gnu95FCompiler using config 
C compiler: gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -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.6/include/python2.6 -c' 
gcc-4.0: _configtest.c 
gcc-4.0 _configtest.o -o _configtest 
success! 
removing: _configtest.c _configtest.o _configtest 
C compiler: gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -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.6/include/python2.6 -c' 
gcc-4.0: _configtest.c 
_configtest.c:1: warning: conflicting types for built-in function ‘exp’ 
_configtest.c:1: warning: conflicting types for built-in function ‘exp’ 
gcc-4.0 _configtest.o -o _configtest 
success! 
removing: _configtest.c _configtest.o _configtest 
building extension "numpy.core._sort" sources 
Generating build/src.macosx-10.3-fat-2.6/numpy/core/include/numpy/config.h 
C compiler: gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -fno-common -dynamic -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.6/include/python2.6 -c' 
gcc-4.0: _configtest.c 
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, 
       from _configtest.c:1: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, 
       from _configtest.c:1: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
lipo: can't figure out the architecture type of: /var/tmp//ccRwrtCy.out 
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, 
       from _configtest.c:1: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
In file included from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/unicodeobject.h:4, 
       from /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:85, 
       from _configtest.c:1: 
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
lipo: can't figure out the architecture type of: /var/tmp//ccRwrtCy.out 
failure. 
removing: _configtest.c _configtest.o 
Traceback (most recent call last): 
    File "setup.py", line 210, in <module> 
    setup_package() 
    File "setup.py", line 203, in setup_package 
    configuration=configuration) 
    File "/Users/Software/numpy/numpy/distutils/core.py", line 186, in setup 
    return old_setup(**new_attr) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup 
    dist.run_commands() 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands 
    self.run_command(cmd) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command 
    cmd_obj.run() 
    File "/Users/Software/numpy/numpy/distutils/command/install.py", line 55, in run 
    r = old_install.run(self) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/install.py", line 577, in run 
    self.run_command('build') 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command 
    self.distribution.run_command(command) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command 
    cmd_obj.run() 
    File "/Users/Software/numpy/numpy/distutils/command/build.py", line 37, in run 
    old_build.run(self) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/command/build.py", line 134, in run 
    self.run_command(cmd_name) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/cmd.py", line 333, in run_command 
    self.distribution.run_command(command) 
    File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command 
    cmd_obj.run() 
    File "/Users/Software/numpy/numpy/distutils/command/build_src.py", line 152, in run 
    self.build_sources() 
    File "/Users/Software/numpy/numpy/distutils/command/build_src.py", line 169, in build_sources 
    self.build_extension_sources(ext) 
    File "/Users/Software/numpy/numpy/distutils/command/build_src.py", line 328, in build_extension_sources 
    sources = self.generate_sources(sources, ext) 
    File "/Users/Software/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources 
    source = func(extension, build_dir) 
    File "numpy/core/setup.py", line 395, in generate_config_h 
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir) 
    File "numpy/core/setup.py", line 41, in check_types 
    out = check_types(*a, **kw) 
    File "numpy/core/setup.py", line 260, in check_types 
    "Cannot compile 'Python.h'. Perhaps you need to "\ 
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel. 

Je Xcode déjà installé depuis que j'ai gcc (version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1) il semble donc peu probable que ces fichiers d'en-tête n'existent pas. Une idée de ce qui pourrait arriver?

merci.

Répondre

0

Il existe une version (même un peu périmée) de numpy déjà incluse sur Mac OS X 10.6 dans l'installation par défaut de Python 2.6. Cependant, si vous voulez une version plus récente de numpy ou si vous voulez numpy + scipy, alors je vous suggère de lire mes instructions d'installation: Python2.6+NumPy+SciPy+MatPlotLib on Mac OS X 10.6.

Modifier
Quant aux messages d'erreur que vous obtenez .... Notez qu'il dit « 10.4 »; numpy a le SDK Mac OS X 10.4 codé en dur dedans pour une raison quelconque, donc si vous n'avez pas installé le SDK 10.4 (qui est facultatif et n'est pas installé par défaut), alors vous obtiendrez ces erreurs. Si vous réinstallez Xcode et sélectionnez le SDK Mac OS X 10.4 pour qu'il soit installé, cela devrait résoudre les problèmes que vous rencontrez. Cela dit, je recommande fortement d'installer MacPython 2.6 de Python.org et la version binaire de numpy.

+0

P.S. Vous n'avez pas besoin de lire au-delà de l'installation de NumPy. –

1

J'ai installé le python emballé EPD avec tous les paquets scientifiques sur OS X 10.6 à partir de ces deux pages: http://cse.ucdavis.edu/~chaos/courses/nlp/Software/PythonOSXInstall.htmlhttp://www.soton.ac.uk/~fangohr/computing/pythonsoft.html

Espérons qu'il est utile.

+0

Je viens d'essayer Enthought. Le problème est qu'il ne semble pas fonctionner avec easy_install .. si j'essaie d'installer des paquets qui dépendent de numpy, qui fait partie de enthought, easy_install regarde toujours mon ancien python dans /Bibliothèque/Frameworks/Python.framework/Versions /2.6/ - Comment puis-je changer cela? – user248237dfsf

+0

Vous pouvez changer votre variable d'environnement PATH de sorte que l'une apparaisse en premier. Ensuite, lorsque vous tapez easy_install, python etc, elle utilisera la version enthought. – robince

Questions connexes