【问题标题】:install scipy on windows with easy_install使用 easy_install 在 Windows 上安装 scipy
【发布时间】:2014-01-02 05:14:06
【问题描述】:

我在Windows 7上安装了python 2.7 64bit,后来发现我的windows是32位的……

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

无论如何,它仍然有效!我还在windows路径下添加了python安装目录。

我使用 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

谢谢。

【问题讨论】:

    标签: python windows-7 easy-install


    【解决方案1】:

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

    或者,有许多预构建安装,包括 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,而且经常需要新包。
    • 如果你在 Linux 上,那么easy-install 工作正常,但pip 通常工作得更好,有时我发现apt-get install 是要走的路——一些不在存储库中的包我刚刚下载了 tar 并解压,(或在某些情况下使用 hg 或 git 提取),然后在结果目录中使用 python setup.py install。问题在于 Windows,因为大多数人无法构建扩展模块 - 在 Windows 上,我通常最终会寻找预构建的安装程序。
    • 我觉得最好的办法是Anaconda,里面有scipy、numpy、pandas等400个python数据科学包
    猜你喜欢
    • 1970-01-01
    • 2012-06-17
    • 2012-04-20
    • 1970-01-01
    • 2015-03-24
    • 2012-12-25
    • 1970-01-01
    • 2018-10-30
    • 2015-12-08
    相关资源
    最近更新 更多