本文介绍了您如何在Python中安装blaze模块(Continuum Analytics)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Python中本机(即,不在虚拟环境中)安装 blaze ?我发现的唯一说明在软件包的文档中(请参阅链接),并且此处,在虚拟环境中.

How do you install blaze natively (i.e., not in a virtual environment) in Python? The only instructions I find are on in the package's doc (see link), and here, in a virtual environment.

推荐答案

我没有在网上找到任何相关说明,但这相对简单.

I didn't find any instructions anywhere online for this, but it's relatively straightforward.

关于我使用的平台/工具:

About my platform/tools I used:

  • Mac OSX(山狮)
  • Python 2.7.3
  • 自制软件
  • pip
  • 似乎您可能需要安装Cython,但不确定,因为我已经安装了它.您可以使用pip install Cython进行此操作.
  • Mac OSX (Mountain Lion)
  • Python 2.7.3
  • homebrew
  • pip
  • It looks like you might need to install Cython, not sure as I already had it installed. You can do this with pip install Cython.

首先,brew install llvm.

这是您需要的软件包.您可以全部pip:

Here are the packages you need. You can pip all of them:

  • llvmpy
  • numba
  • meta
  • ply
  • blosc
  • sphinx-适用于文档
  • aterm
  • llvmpy
  • numba
  • meta
  • ply
  • blosc
  • sphinx -- for doc
  • aterm

一旦您放入了所有内容,

Once you've pipped everything,

  • cd /tmp当然取决于您...
  • sudo git clone [email protected]:ContinuumIO/blaze-core.git
  • cd /tmp/blaze-core
  • sudo make build
  • sudo make docs
  • sudo python setup.py install(当然,是否需要sudo取决于您将内容混到何处.)
  • cd /tmp up to you, of course...
  • sudo git clone [email protected]:ContinuumIO/blaze-core.git
  • cd /tmp/blaze-core
  • sudo make build
  • sudo make docs
  • sudo python setup.py install(Whether you need sudo depends on where you git things to, of course.)

我在运行测试时遇到了麻烦,似乎某个地方的__init__.py文件中有错误,但是我不确定.我无法运行单元测试,因此请成功安装".无论如何,我都可以进行抽查以查看模块是否正确导入:

I've had trouble running the tests, it looks like there's an error in an __init__.py file somewhere, but I can't be for sure. I can't get the unit tests to run, so take "successful installation" with a grain of salt. At any rate, I can do a spot check to see that the module imports correctly:

>>> import blaze
>>> from blaze import Array, dshape
>>> ds=dshape('2,2,int')
>>> a = Array([1,2,3,4],ds)
>>> a
Array
  datashape := 2, 2, int 
  values    := [CArray(ptr=140454075688080)] 
  metadata  := [manifest, arraylike] 
  layout    := Chunked(dim=0) 
[1 2 3 4]

这篇关于您如何在Python中安装blaze模块(Continuum Analytics)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 22:54