为pypy3安装numpy时出错

时间:2015-02-22 12:11:15

标签: numpy installation pypy

尝试在我的MacBook上为pypy3安装numpy,我收到一个错误。

以下是安装numpy的说明。

git clone https://bitbucket.org/pypy/numpy.git
cd numpy
pypy3 setup.py install

但是当我启动" pypy3 setup.py install时,我收到以下错误消息:

Running from numpy source directory.
/usr/local/Cellar/pypy3/2.4.0/libexec/lib_pypy/__pycache__/_cffi__g93a4bf4dxace1544d.c:2:10: fatal error: 
  'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'
warnings.warn(msg)
non-existing path in 'numpy/distutils': 'site.cfg'
non-existing path in 'numpy/f2py': 'docs'
non-existing path in 'numpy/f2py': 'f2py.1'
F2PY Version 2
blas_opt_info:
blas_mkl_info:
libraries mkl,vml,guide not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

openblas_info:
libraries openblas not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3)]

non-existing path in 'numpy/lib': 'benchmarks'
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

lapack_mkl_info:
mkl_info:
libraries mkl,vml,guide not found in ['/usr/local/Cellar/pypy3/2.4.0/libexec/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE

NOT AVAILABLE

atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in /usr/local/Cellar/pypy3/2.4.0/libexec/lib
libraries lapack_atlas not found in /usr/local/Cellar/pypy3/2.4.0/libexec/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/local/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE

atlas_info:
libraries f77blas,cblas,atlas not found in /usr/local/Cellar/pypy3/2.4.0/libexec/lib
libraries lapack_atlas not found in /usr/local/Cellar/pypy3/2.4.0/libexec/lib
libraries f77blas,cblas,atlas not found in /usr/local/lib
libraries lapack_atlas not found in /usr/local/lib
libraries f77blas,cblas,atlas not found in /usr/lib
libraries lapack_atlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE

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

/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
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 Gnu95FCompiler
Found executable /usr/local/bin/gfortran
/Users/remioudin/numpy/numpy/distutils/fcompiler/gnu.py:129: UserWarning: Env. variable MACOSX_DEPLOYMENT_TARGET set to 10.3
  warnings.warn(s)
customize Gnu95FCompiler
customize Gnu95FCompiler using config
C compiler: cc -arch x86_64 -O2 -fPIC -Wimplicit -O2 -fPIC -Wimplicit

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/src/npysort -Inumpy/core/include -I/usr/local/Cellar/pypy3/2.4.0/libexec/include -c'
cc: _configtest.c
cc -arch x86_64 _configtest.o -o _configtest
ld: library not found for -lcrt1.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: library not found for -lcrt1.o
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 251, in <module>
    setup_package()
  File "setup.py", line 243, in setup_package
    setup(**metadata)
  File "/Users/remioudin/numpy/numpy/distutils/core.py", line 169, in setup
     return old_setup(**new_attr)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/core.py", line 148, in setup
dist.run_commands()
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py", line 917, in run_commands
self.run_command(cmd)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py", line 936, in run_command
cmd_obj.run()
  File "/Users/remioudin/numpy/numpy/distutils/command/install.py", line 60, in run
r = old_install.run(self)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/command/install.py", line 579, in run
self.run_command('build')
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py", line 936, in run_command
cmd_obj.run()
  File "/Users/remioudin/numpy/numpy/distutils/command/build.py", line 39, in run
old_build.run(self)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/command/build.py", line 126, in run
self.run_command(cmd_name)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
  File "/usr/local/Cellar/pypy3/2.4.0/libexec/lib-python/3/distutils/dist.py", line 936, in run_command
cmd_obj.run()
  File "/Users/remioudin/numpy/numpy/distutils/command/build_src.py", line 153, in run
self.build_sources()
  File "/Users/remioudin/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources
self.build_library_sources(*libname_info)
  File "/Users/remioudin/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
  File "/Users/remioudin/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources
source = func(extension, build_dir)
  File "numpy/core/setup.py", line 688, in get_mathlib_info
raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program

你知道这是什么问题吗?

2 个答案:

答案 0 :(得分:1)

你是对的......

Numpy仅适用于与Python 2.7兼容的Pypy 2.5.0。

我实际上使用的是Python 3.4.2,所以我的所有文件都与pypy3兼容而不是pypy。 我会做没有numpy然后...... 希望他们能够在接下来的几个月内使其适用于pypy3!

答案 1 :(得分:0)

https://bitbucket.org/pypy/numpy - 您是否已通过pypy验证numpy版本是否适用于pypy3?快速阅读他们的网站表明它仍在进行中。

  

目前,NumPyPy仅适用于Python 2,并且不完整。您可能会收到警告或NotImplemented错误。如果您遇到崩溃或错误的结果,请告诉我们。