如何安装 scipy 杂项包
How to install scipy misc package
我已经安装了(实际上是重新安装)scipy:
10_x86_64.whl (19.8MB): 19.8MB downloaded
Installing collected packages: scipy
Successfully installed scipy
但是misc分包好像没有包含?
16:03:28/shared $ipython
In [1]: from scipy.misc import imread
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-f9d3d927b58f> in <module>()
----> 1 from scipy.misc import imread
ImportError: cannot import name imread
安装scipy.misc包的方法是什么?
我认为您还需要安装 PIL。来自 the scipy.misc docs:
Note that the Python Imaging Library (PIL) is not a dependency of SciPy and therefore the pilutil module is not available on systems that don’t have PIL installed.
我有同样的问题,运行宁 Python 2.7.12 在旧的 Windows XP/SP3 盒子上。我在 MacBook Python 上有一些东西 运行ning,我想让它在旧的 Windows 盒子上工作。 可以完成。 winbox 有 pip 版本。 8,我升级到pip ver。 9,在 Python 中,使用 pip 在您 运行 时提供的建议。我已经使用 "pip install numpy" 和 "pip install Pillow" 安装了 numpy 和 Pillow(PIL 的当前版本),但是 "pip install scipy" 和 "pip install scipy.misc" 因 "no matching distribution found" 而失败。我不得不卸载 numpy,然后安装两个文件:1) numpy+mkl,然后 2) scipy,安装的两个文件都是 Windows 的二进制文件,采用 .whl(wheel)存档格式,下载自: http://www.lfd.uci.edu/~gohlke/pythonlibs/
站点由 Christoph Gohlke 维护。找到您需要的二进制版本 Windows,并将它们下载到 C:\some\directory。安装顺序很重要。首先使用 pip 安装 numpy+mkl,然后安装 scipy 文件。我从 Gohlke 的站点下载了这些文件,然后使用 pip 安装它们。对于我的旧 winbox,这是:
C:\some\directory\> pip install numpy-1.12.1rc1+mkl-cp27-cp27m-win32.whl
(你应该看到)
Installing collected packages: numpy
Successfully installed numpy-1.12.1rc1+mkl
(那么,你可以运行)
C:\some\directory\> pip install scipy-0.18.1-cp27-cp27m-win32.whl
您应该会看到 "Successfully installed..." 消息。我已经安装了 Pillow。
通过启动 Python 并尝试确认:
>>> import numpy as np
>>> from PIL import Image, ImageDraw
>>> import scipy.misc
所有这些都应该有效。你应该能够渲染一个.jpg:
image = Image.open("Somefile.jpg")
image.show()
并且您的 somefile.jpg 将会显示。
我已经安装了(实际上是重新安装)scipy:
10_x86_64.whl (19.8MB): 19.8MB downloaded
Installing collected packages: scipy
Successfully installed scipy
但是misc分包好像没有包含?
16:03:28/shared $ipython
In [1]: from scipy.misc import imread
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-f9d3d927b58f> in <module>()
----> 1 from scipy.misc import imread
ImportError: cannot import name imread
安装scipy.misc包的方法是什么?
我认为您还需要安装 PIL。来自 the scipy.misc docs:
Note that the Python Imaging Library (PIL) is not a dependency of SciPy and therefore the pilutil module is not available on systems that don’t have PIL installed.
我有同样的问题,运行宁 Python 2.7.12 在旧的 Windows XP/SP3 盒子上。我在 MacBook Python 上有一些东西 运行ning,我想让它在旧的 Windows 盒子上工作。 可以完成。 winbox 有 pip 版本。 8,我升级到pip ver。 9,在 Python 中,使用 pip 在您 运行 时提供的建议。我已经使用 "pip install numpy" 和 "pip install Pillow" 安装了 numpy 和 Pillow(PIL 的当前版本),但是 "pip install scipy" 和 "pip install scipy.misc" 因 "no matching distribution found" 而失败。我不得不卸载 numpy,然后安装两个文件:1) numpy+mkl,然后 2) scipy,安装的两个文件都是 Windows 的二进制文件,采用 .whl(wheel)存档格式,下载自: http://www.lfd.uci.edu/~gohlke/pythonlibs/ 站点由 Christoph Gohlke 维护。找到您需要的二进制版本 Windows,并将它们下载到 C:\some\directory。安装顺序很重要。首先使用 pip 安装 numpy+mkl,然后安装 scipy 文件。我从 Gohlke 的站点下载了这些文件,然后使用 pip 安装它们。对于我的旧 winbox,这是:
C:\some\directory\> pip install numpy-1.12.1rc1+mkl-cp27-cp27m-win32.whl
(你应该看到)
Installing collected packages: numpy
Successfully installed numpy-1.12.1rc1+mkl
(那么,你可以运行)
C:\some\directory\> pip install scipy-0.18.1-cp27-cp27m-win32.whl
您应该会看到 "Successfully installed..." 消息。我已经安装了 Pillow。 通过启动 Python 并尝试确认:
>>> import numpy as np
>>> from PIL import Image, ImageDraw
>>> import scipy.misc
所有这些都应该有效。你应该能够渲染一个.jpg:
image = Image.open("Somefile.jpg")
image.show()
并且您的 somefile.jpg 将会显示。