我是MSYS2的新手,所以我尝试使用pip(mingw-w64-x86_64-python3-pip-9.0.1-3)安装numpy,但安装失败了。这是输出:
(...) C编译器:x86_64-pc-msys-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -march = x86-64 -mtune = generic -O2 -pipe
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 -I/usr/include/python3.6m -c'
x86_64-pc-msys-gcc: _configtest.c
/usr/bin/bash: x86_64-pc-msys-gcc: command not found
/usr/bin/bash: x86_64-pc-msys-gcc: command not found
failure.
removing: _configtest.c _configtest.o
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-3d852664/numpy/setup.py", line 394, in <module>
setup_package()
File "/tmp/pip-build-3d852664/numpy/setup.py", line 386, in setup_package
setup(**metadata)
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/core.py", line 169, in setup
return old_setup(**new_attr)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/install.py", line 62, in run
r = self.setuptools_run()
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
return distutils_install.run(self)
File "/usr/lib/python3.6/distutils/command/install.py", line 551, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 314, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/build.py", line 47, in run
old_build.run(self)
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 314, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/build_src.py", line 148, in run
self.build_sources()
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/build_src.py", line 159, in build_sources
self.build_library_sources(*libname_info)
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/build_src.py", line 294, in build_library_sources
sources = self.generate_sources(sources, (lib_name, build_info))
File "/tmp/pip-build-3d852664/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
source = func(extension, build_dir)
File "numpy/core/setup.py", line 675, in get_mathlib_info
raise RuntimeError("Broken toolchain: cannot link a simple C program")
RuntimeError: Broken toolchain: cannot link a simple C program
----------------------------------------
命令&#34; / usr / bin / python3 -u -c&#34;导入setuptools,tokenize; 文件 =&#39; / tmp / pip-build-3d852664 / numpy /setup.py';f=getattr(tokenize,' open&#39;,open)( file ); code = f.read()。replace(&#39; \ r \ n&#39;,&#39; \ n&#39;); f.close(); exec(编译(代码,文件,&#39; exec&#39;)) &#34; install --record /tmp/pip-4nnf7xbj-record/install-record.txt --single-version-external-managed --compile&#34;在/ tmp / pip-build-3d852664 / numpy /
中出现错误代码1失败我已经安装了工具:我使用了https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2上的教程(我只有64位软件包)
我在网上查找了类似的问题,但我发现没有相关内容。 欢迎提出任何意见或建议
提前致谢
答案 0 :(得分:1)
pacman -S mingw-w64-x86_64-python-scipy
pacman -S mingw-w64-i686-python-scipy
答案 1 :(得分:0)
尚未安装正确的gcc编译器。对于我的安装,我使用了msys2 shell(不是mingw)并安装了msys / gcc包:
pacman -S msys/gcc