无法使用 pip Python 3.6 安装 numpy 或 pygame
Can't install numpy or pygame with pip Python 3.6
我最近在 Windows 10 上升级到 Python 3.6 以便使用最新的格式化语法对于我目前正在编写的基于文本的 RPG 游戏。
游戏需要使用 2 个外部模块(numpy
和 pygame
)才能运行。
我在 cmd
中尝试了常用的命令 pip install module_name
,但它向我抛出一条错误消息。
浏览完SO我用命令pip install --upgrade pip
升级了pip
,已经是最新版本了。
我也使用命令 pip install --upgrade wheel
并且我的 wheel
已升级到最新版本。
我也使用了命令 pip install --upgrade setuptools
并且我的 setuptools
升级到了最新版本。
我又试了一次,还是不行。两个模块都不会安装。
编辑: 我用 numpy
和 pygame
尝试了 easy_install module_name
,但都没有安装。我也试过 pip3.6 install --trusted-host pypi.python.org numpy
但没用。
我已经将此作为一个单独的问题提出,因为我已经尝试了其他 SO 问题中的建议,但没有奏效。另外,这涉及 numpy
和 pygame
模块,没有其他问题。
我的 pygame
错误消息:
C:\Users\zactheblackdragon>python -m pip install pygame
Collecting pygame
Using cached pygame-1.9.2.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-ovlzq9si\pygame\setup.py", line 165, in <module>
extensions = read_setup_file('Setup')
File "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\extension.py", line 171, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\sysconfig.py", line 410, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: must be str, not NoneType
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-ovlzq9si\pygame\
我的 numpy
错误消息:
C:\Users\zactheblackdragon>python -m pip install numpy
Collecting numpy
Using cached numpy-1.11.3.zip
Building wheels for collected packages: numpy
Running setup.py bdist_wheel for numpy ... error
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\ZACTHE~1\AppData\Local\Temp\tmpm39rz3bgpip-wheel- --python-tag cp36:
Running from numpy source directory.
blas_opt_info:
blas_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1630: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
libraries blas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1639: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1642: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
NOT AVAILABLE
non-existing path in 'numpy\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
lapack_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1532: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
libraries lapack not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1543: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1546: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
NOT AVAILABLE
C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running bdist_wheel
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
creating build
creating build\src.win-amd64-3.6
creating build\src.win-amd64-3.6\numpy
creating build\src.win-amd64-3.6\numpy\distutils
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Failed building wheel for numpy
Running setup.py clean for numpy
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
Running from numpy source directory.
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
----------------------------------------
Failed cleaning build dir for numpy
Failed to build numpy
Installing collected packages: numpy
Running setup.py install for numpy ... error
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ZACTHE~1\AppData\Local\Temp\pip-dn2eq0_h-record\install-record.txt --single-version-externally-managed --compile:
Running from numpy source directory.
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install numpy` (last Numpy release on PyPi)
blas_opt_info:
blas_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1630: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
libraries blas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1639: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1642: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
NOT AVAILABLE
non-existing path in 'numpy\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
lapack_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1532: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
libraries lapack not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1543: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1546: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
NOT AVAILABLE
C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py:261: 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
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ZACTHE~1\AppData\Local\Temp\pip-dn2eq0_h-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\
我遇到了同样的问题。
下载并安装Microsoft Visual C++ Build Tools。
转到 this page 并下载适合您的 Python 和 Windows 版本的 .whl 文件。在我的例子中是 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl 因为我使用 Python 3.6.0 和 Windows 64 位。将文件粘贴到 Python 文件夹(在我的例子中是 C:\Python)
接下来,在按住 Shift 键的同时,右键单击 Python 安装文件夹并选择 "Open command window here"。 cmd window 将打开。
输入以下内容:
pip install setuptools
pip install wheel
安装 Microsoft Visual C++ Build Tools 后,使用以下命令安装 numpy:
pip install numpy
如果您下载了 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl,请安装 Pygame:
pip install pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl
或者将 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl
更改为您下载的文件的名称。
在输入上一个命令之前,请确保您下载的文件位于 Python 文件夹 (在我的例子中,C:\Python\pygame‑1.9.2‑cp36 ‑cp36m‑win_amd64.whl) 并且您复制了包括 .whl 扩展名在内的整个文件名,否则它将无法工作。
这应该安装 numpy 和 pygame。
对于那些试图在 Windows 10 上安装 pygame 的人,现在只需键入:
pip install pygame
它会自动为您完成。您不必再去网站下载 whl 文件。
我最近在 Windows 10 上升级到 Python 3.6 以便使用最新的格式化语法对于我目前正在编写的基于文本的 RPG 游戏。
游戏需要使用 2 个外部模块(numpy
和 pygame
)才能运行。
我在 cmd
中尝试了常用的命令 pip install module_name
,但它向我抛出一条错误消息。
浏览完SO我用命令pip install --upgrade pip
升级了pip
,已经是最新版本了。
我也使用命令 pip install --upgrade wheel
并且我的 wheel
已升级到最新版本。
我也使用了命令 pip install --upgrade setuptools
并且我的 setuptools
升级到了最新版本。
我又试了一次,还是不行。两个模块都不会安装。
编辑: 我用 numpy
和 pygame
尝试了 easy_install module_name
,但都没有安装。我也试过 pip3.6 install --trusted-host pypi.python.org numpy
但没用。
我已经将此作为一个单独的问题提出,因为我已经尝试了其他 SO 问题中的建议,但没有奏效。另外,这涉及 numpy
和 pygame
模块,没有其他问题。
我的 pygame
错误消息:
C:\Users\zactheblackdragon>python -m pip install pygame
Collecting pygame
Using cached pygame-1.9.2.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "config.py"
Using WINDOWS configuration...
Path for SDL not found.
Too bad that is a requirement! Hand-fix the "Setup"
Path for FONT not found.
Path for IMAGE not found.
Path for MIXER not found.
Path for PNG not found.
Path for JPEG not found.
Path for PORTMIDI not found.
Path for COPYLIB_tiff not found.
Path for COPYLIB_z not found.
Path for COPYLIB_vorbis not found.
Path for COPYLIB_ogg not found.
If you get compiler errors during install, doublecheck
the compiler flags in the "Setup" file.
Continuing With "setup.py"
Error with the "Setup" file,
perhaps make a clean copy from "Setup.in".
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-ovlzq9si\pygame\setup.py", line 165, in <module>
extensions = read_setup_file('Setup')
File "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\extension.py", line 171, in read_setup_file
line = expand_makefile_vars(line, vars)
File "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\sysconfig.py", line 410, in expand_makefile_vars
s = s[0:beg] + vars.get(m.group(1)) + s[end:]
TypeError: must be str, not NoneType
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-ovlzq9si\pygame\
我的 numpy
错误消息:
C:\Users\zactheblackdragon>python -m pip install numpy
Collecting numpy
Using cached numpy-1.11.3.zip
Building wheels for collected packages: numpy
Running setup.py bdist_wheel for numpy ... error
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\ZACTHE~1\AppData\Local\Temp\tmpm39rz3bgpip-wheel- --python-tag cp36:
Running from numpy source directory.
blas_opt_info:
blas_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1630: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
libraries blas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1639: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1642: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
NOT AVAILABLE
non-existing path in 'numpy\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
lapack_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1532: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
libraries lapack not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1543: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1546: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
NOT AVAILABLE
C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
running bdist_wheel
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
creating build
creating build\src.win-amd64-3.6
creating build\src.win-amd64-3.6\numpy
creating build\src.win-amd64-3.6\numpy\distutils
building library "npymath" sources
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Failed building wheel for numpy
Running setup.py clean for numpy
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all:
Running from numpy source directory.
`setup.py clean` is not supported, use one of the following instead:
- `git clean -xdf` (cleans all files)
- `git clean -Xdf` (cleans all versioned files, doesn't touch
files that aren't checked into the git repo)
Add `--force` to your command to use it anyway if you must (unsupported).
----------------------------------------
Failed cleaning build dir for numpy
Failed to build numpy
Installing collected packages: numpy
Running setup.py install for numpy ... error
Complete output from command C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ZACTHE~1\AppData\Local\Temp\pip-dn2eq0_h-record\install-record.txt --single-version-externally-managed --compile:
Running from numpy source directory.
Note: if you need reliable uninstall behavior, then install
with pip instead of using `setup.py install`:
- `pip install .` (from a git repo or downloaded source
release)
- `pip install numpy` (last Numpy release on PyPi)
blas_opt_info:
blas_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1630: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
libraries blas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1639: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [blas]) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1642: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [blas_src]) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
NOT AVAILABLE
non-existing path in 'numpy\distutils': 'site.cfg'
F2PY Version 2
lapack_opt_info:
openblas_lapack_info:
libraries openblas not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
lapack_mkl_info:
libraries mkl_rt not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries tatlas,tatlas not found in C:\
libraries lapack_atlas not found in C:\
libraries tatlas,tatlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries satlas,satlas not found in C:\
libraries lapack_atlas not found in C:\
libraries satlas,satlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries ptf77blas,ptcblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries ptf77blas,ptcblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib
libraries f77blas,cblas,atlas not found in C:\
libraries lapack_atlas not found in C:\
libraries f77blas,cblas,atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
libraries lapack_atlas not found in C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1532: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
lapack_info:
libraries lapack not found in ['C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib', 'C:\', 'C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\libs']
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1543: UserWarning:
Lapack (http://www.netlib.org/lapack/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [lapack]) or by setting
the LAPACK environment variable.
warnings.warn(LapackNotFoundError.__doc__)
lapack_src_info:
NOT AVAILABLE
C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\numpy\distutils\system_info.py:1546: UserWarning:
Lapack (http://www.netlib.org/lapack/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section [lapack_src]) or by setting
the LAPACK_SRC environment variable.
warnings.warn(LapackSrcNotFoundError.__doc__)
NOT AVAILABLE
C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py:261: 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
No module named 'numpy.distutils._msvccompiler' in numpy.distutils; trying from distutils
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
----------------------------------------
Command "C:\Users\zactheblackdragon\AppData\Local\Programs\Python\Python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\ZACTHE~1\AppData\Local\Temp\pip-dn2eq0_h-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\ZACTHE~1\AppData\Local\Temp\pip-build-i_43zwj2\numpy\
我遇到了同样的问题。
下载并安装Microsoft Visual C++ Build Tools。
转到 this page 并下载适合您的 Python 和 Windows 版本的 .whl 文件。在我的例子中是 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl 因为我使用 Python 3.6.0 和 Windows 64 位。将文件粘贴到 Python 文件夹(在我的例子中是 C:\Python)
接下来,在按住 Shift 键的同时,右键单击 Python 安装文件夹并选择 "Open command window here"。 cmd window 将打开。
输入以下内容:
pip install setuptools
pip install wheel
安装 Microsoft Visual C++ Build Tools 后,使用以下命令安装 numpy:
pip install numpy
如果您下载了 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl,请安装 Pygame:
pip install pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl
或者将 pygame‑1.9.2‑cp36‑cp36m‑win_amd64.whl
更改为您下载的文件的名称。
在输入上一个命令之前,请确保您下载的文件位于 Python 文件夹 (在我的例子中,C:\Python\pygame‑1.9.2‑cp36 ‑cp36m‑win_amd64.whl) 并且您复制了包括 .whl 扩展名在内的整个文件名,否则它将无法工作。
这应该安装 numpy 和 pygame。
对于那些试图在 Windows 10 上安装 pygame 的人,现在只需键入:
pip install pygame
它会自动为您完成。您不必再去网站下载 whl 文件。