gpt4 book ai didi

python - NumPy 不会在 Win7 的 Python 3.4.0 中安装

转载 作者:太空狗 更新时间:2023-10-29 20:20:11 26 4
gpt4 key购买 nike

我看了之前的一篇相关帖子,评论者说“你为什么不使用 Windows 安装程序?”

所以我点击链接下载了https://pypi.python.org/packages/3.4/n/numpy/numpy-1.8.1-cp34-cp34m-macosx_10_6_intel.whl#md5=08043cc4eaa6267ac2f872924e11ae7c

但是当我点击它时,Win7 说它不知道如何运行它。我应该如何处理该文件?

之前我尝试通过从\Python34\Scripts 文件夹运行“pip3 install numpy”将 Numpy 安装到 Py 3.4.0。

它给出了 340 行错误。开始于:

Downloading/unpacking numpy  Running setup.py (path:C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\numpy\setup.py) egg_info for package numpy    Running from numpy source directory.    warning: no files found matching 'tools\py3tool.py'    warning: no files found matching '*' under directory 'doc\f2py'    warning: no previously-included files matching '*.pyc' found anywhere in distribution    warning: no previously-included files matching '*.pyo' found anywhere in distribution    warning: no previously-included files matching '*.pyd' found anywhere in distributionInstalling collected packages: numpy  Running setup.py install for numpy    non-existing path in 'numpy\\distutils': 'site.cfg'    F2PY Version 2    blas_opt_info:    blas_mkl_info:      libraries mkl,vml,guide not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']      NOT AVAILABLE    openblas_info:      libraries  not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']      NOT AVAILABLE    atlas_blas_threads_info:    Setting PTATLAS=ATLAS      libraries ptf77blas,ptcblas,atlas not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']      NOT AVAILABLE    atlas_blas_info:      libraries f77blas,cblas,atlas not found in ['C:\\Python34\\lib', 'C:\\', 'C:\\Python34\\libs']      NOT AVAILABLE

为什么所有这些文件都丢失了? Py 3.4.0 似乎运行良好。

所以我尝试类似地使用 pip3 安装 scipy。那太炸了,也就是说:

Downloading/unpacking scipy  Running setup.py (path:C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py) egg_info for package scipy    warning: no previously-included files matching '*_subr_*.f' found under directory 'scipy\linalg\src\id_dist\src'    no previously-included directories found matching 'scipy\special\tests\data\boost'    no previously-included directories found matching 'scipy\special\tests\data\gsl'    no previously-included directories found matching 'doc\build'    no previously-included directories found matching 'doc\source\generated'    warning: no previously-included files matching '*.pyc' found anywhere in distribution    warning: no previously-included files matching '*~' found anywhere in distribution    warning: no previously-included files matching '*.bak' found anywhere in distribution    warning: no previously-included files matching '*.swp' found anywhere in distribution    warning: no previously-included files matching '*.pyo' found anywhere in distributionInstalling collected packages: scipy  Running setup.py install for scipy    Traceback (most recent call last):      File "", line 1, in       File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 237, in         setup_package()      File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 225, in setup_package        from numpy.distutils.core import setup    ImportError: No module named 'numpy'    Complete output from command C:\Python34\python.EXE -c "import setuptools, tokenize;__file__='C:\\Users\\Windows\\AppData\\Local\\Temp\\pip_build_Windows\\scipy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Windows\AppData\Local\Temp\pip-qqtgehrv-record\install-record.txt --single-version-externally-managed --compile:    Traceback (most recent call last):  File "", line 1, in   File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 237, in     setup_package()  File "C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipy\setup.py", line 225, in setup_package    from numpy.distutils.core import setupImportError: No module named 'numpy'----------------------------------------Cleaning up...Command C:\Python34\python.EXE -c "import setuptools, tokenize;__file__='C:\\Users\\Windows\\AppData\\Local\\Temp\\pip_build_Windows\\scipy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Windows\AppData\Local\Temp\pip-qqtgehrv-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in C:\Users\Windows\AppData\Local\Temp\pip_build_Windows\scipyStoring debug log for failure in C:\Users\Windows\pip\pip.log

最佳答案

不是解决方案,而是一个简单的解决方法

不幸的是,Python 3 中的标准打包工具在 Windows 中工作得非常糟糕。即使您已经从 MS Visual Studio 2010 安装了编译器,您也可能会遇到像您这样的问题,以防安装的包需要编译一些 native 代码。在遇到 Anaconda Python distribution 之前,我一直在解决类似的问题这使得这些事情变得非常容易。

Anaconda 支持所有参数组合的分布:

  • Python 版本(2.7 或 3.*)
  • 平台——Windows、Mac、Linux
  • 处理器架构——32 位或 64 位

它本身包含 Python 和大约 200 个包(参见 list ),包括 NumPy、SciPy 等。

如果你不想安装所有这些包,你可以使用Miniconda它只包含 Python 和包管理器。一旦你安装了它,你可以通过发出这样的命令来添加任何包:

conda install numpy

关于python - NumPy 不会在 Win7 的 Python 3.4.0 中安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24009413/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com