在Windows上使用easy_install安装scipy

3

我在Windows 7上安装了Python 2.7 64位版本。后来我意识到我的Windows是32位的...

Python 2.7.6 (default, Nov 10 2013, 19:24:24) [MSC v.1500 64 bit (AMD64)] on win
32

无论如何,它仍然可以工作!我还将python安装目录添加到windows路径中。 然后使用ez_setup脚本安装了easy_install。这也起作用了。
C:\Users\Myname>easy_install
error: No urls, filenames, or requirements specified (see --help)

但是我无法安装Matplolib或Scipy等模块!

C:\Users\Massimo\Dropbox\Python>easy_install scipy
Searching for scipy
Reading https://pypi.python.org/simple/scipy/
Best match: scipy 0.13.2
Downloading https://pypi.python.org/packages/source/s/scipy/scipy-0.13.2.zip#md5
=9befa30e546fba762a0c1695a509f731
Processing scipy-0.13.2.zip
Writing c:\users\massimo\appdata\local\temp\easy_install-v3knvt\scipy-0.13.2\set
up.cfg
Running scipy-0.13.2\setup.py -q bdist_egg --dist-dir c:\users\massimo\appdata\l
ocal\temp\easy_install-v3knvt\scipy-0.13.2\egg-dist-tmp-tatxbl
Traceback (most recent call last):
  File "c:\python27\scripts\easy_install-script.py", line 9, in <module>
    load_entry_point('setuptools==0.8', 'console_scripts', 'easy_install')()
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1992
, in main
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1979
, in with_ei_usage
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1996
, in <lambda>
  File "c:\python27\lib\distutils\core.py", line 152, in setup
    dist.run_commands()
  File "c:\python27\lib\distutils\dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "c:\python27\lib\distutils\dist.py", line 972, in run_command
    cmd_obj.run()
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 380,
 in run
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 623,
 in easy_install
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 653,
 in install_item
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 849,
 in install_eggs
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1130
, in build_and_install
  File "build\bdist.win-amd64\egg\setuptools\command\easy_install.py", line 1115
, in run_setup
  File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 69, in run_setup
  File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 120, in run
  File "build\bdist.win-amd64\egg\setuptools\sandbox.py", line 71, in <lambda>
  File "setup.py", line 230, in <module>
  File "setup.py", line 218, in setup_package
ImportError: No module named numpy.distutils.core

谢谢。
1个回答

10

Christoph Gohlke在这里提供了预构建的Windows安装程序,包括scipy。最好使用其中之一,原因是从源代码安装scipy、numpy和matplotlib需要构建C和Fortran扩展,而大多数Windows计算机没有编译器。

或者,还有一些预构建的安装程序包括Python和其他一些工具:

  • Anaconda:用于SciPy堆栈的免费发行版。支持Linux、Windows和Mac。
  • Enthought Canopy:免费和商业版本均包括核心SciPy堆栈软件包。支持Linux、Windows和Mac。
  • Python(x,y):基于Spyder IDE的免费发行版,包括SciPy堆栈。仅限Windows。
  • WinPython:包括SciPy堆栈的免费发行版。仅限Windows。
  • Pyzo:基于Python 3的免费发行版,带有IEP编辑器。支持Linux和Windows。

非常感谢。听起来很有趣。我想知道是否可以使用easy_install(或其他软件包管理器),因为我主要在GNU / Linux中使用python,经常需要新的软件包。 - altroware
如果你使用的是Linux系统,那么easy-install工具可以正常使用,但是pip工具通常更好用。有时候我也会使用apt-get install命令来安装一些软件包,如果某些软件包不在仓库中,我就会下载tar包并解压缩,或者使用hg或git拉取代码,然后在生成的目录中运行python setup.py install命令进行安装。问题出现在Windows系统上,因为大多数人无法构建扩展模块 - 在Windows上,我经常寻找预先构建的安装程序。 - Steve Barnes
我认为最好的方式是使用Anaconda,它拥有400个Python数据科学包,例如scipy、numpy和pandas。 - ybdesire

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接