我查看了以前的相关帖子,评论者说“为什么不使用Windows安装程序?"
但是当我点击它时,Win7说它不知道如何运行它。我该怎么办这个文件?
之前我尝试将Numpy安装到Py 3.4.0中,运行' pip3 install numpy'来自\ Python34 \ Scripts文件夹。
它给出了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 distribution Installing 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 distribution Installing 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 setup ImportError: 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\scipy Storing debug log for failure in C:\Users\Windows\pip\pip.log
答案 0 :(得分:6)
不是解决方案,而是一种简单的解决方法
不幸的是,Python 3中的标准打包工具在Windows中运行起来非常糟糕。即使您已经安装了MS Visual Studio 2010中的编译器,您也可能会遇到像您这样的问题,以防安装包需要编译一些本机代码。我遇到了类似的问题,直到遇到Anaconda Python distribution,这使得这些事情变得非常容易。
Anaconda支持所有参数组合的分布:
它本身包含Python和大约200个包(参见list),包括NumPy,SciPy等。
如果您不想安装所有这些软件包,可以使用仅包含Python和软件包管理器的Miniconda。安装完成后,您可以通过发出如下命令来添加任何包:
conda install numpy
答案 1 :(得分:4)
下载" numpy-1.9.2 + mkl-cp34-none-win_amd64.whl"来自here
将此文件复制到C:\ Python34 \ Scripts
在cmd.exe中,运行命令为pip install" numpy-1.9.2 + mkl-cp34-none-win_amd64.whl"
这些步骤将更容易您在Python中安装NumPy,SciPy,SciKit-Learn或任何其他软件包。
我尝试安装SciKit-Learn用于机器学习,但是在Canopy中,我需要订阅。因此,我相信上面列出的这些步骤对于在python中安装任何其他软件包非常有帮助。
答案 2 :(得分:0)
如果你使用PyCharm:
档案>设置>项目:xyz>项目口译员> +>搜索numpy>点击安装。