为python安装numba

mij*_*ijc 15 python installation numba

我正在尝试为python 安装numba但是在按照主页的说明后我得到了这个错误,无法找到extension_types页面.

如果有人知道我做错了什么,或者我错过了应该安装的东西,我将非常感激.

非常感谢你提前.

Python 2.7.2+ (default, Jul 20 2012, 22:15:08) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import numba
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/home/mijc/Downloads/numba/<ipython console> in <module>()

/home/mijc/Downloads/numba/numba/__init__.py in <module>()
      2 # type inferer

      3 from numba.special import *
----> 4 from numba import module_type_inference
      5 
      6 import os

/home/mijc/Downloads/numba/numba/module_type_inference.py in <module>()
      6 from numba import *
      7 from numba.minivect import minitypes
----> 8 from numba import typesystem, symtab
      9 
     10 import numpy.random

/home/mijc/Downloads/numba/numba/typesystem/__init__.py in <module>()
      2 from exttypes import *
      3 from closuretypes import *
      4 from ssatypes import *
      5 from templatetypes import *
      6 from typemapper import *

/home/mijc/Downloads/numba/numba/typesystem/basetypes.py in <module>()
      6 
      7 import numba
----> 8 from numba import  extension_types, error
      9 from numba.minivect.minitypes import *
     10 from numba.minivect.minitypes import map_dtype

ImportError: cannot import name extension_types
Run Code Online (Sandbox Code Playgroud)

编辑:我通过以下方式安装了numba:

git clone https://github.com/numba/numba.git
cd numba
python setup.py install
Run Code Online (Sandbox Code Playgroud)

当我尝试通过pip安装它时,我收到以下错误:

pip install numba --upgrade
Downloading/unpacking numba
  Downloading numba-0.5.0.tar.gz (333Kb): 333Kb downloaded
  Running setup.py egg_info for package numba
    Traceback (most recent call last):
      File "<string>", line 14, in <module>
      File "/home/mijc/Downloads/numba/build/numba/setup.py", line 90, in <module>
        cython_gdb=True),
      File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/extension.py", line 108, in __init__
        **kw)
    TypeError: unbound method __init__() must be called with Extension instance as first argument (got Extension instance instead)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 14, in <module>

  File "/home/mijc/Downloads/numba/build/numba/setup.py", line 90, in <module>

    cython_gdb=True),

  File "/usr/local/lib/python2.7/dist-packages/Cython/Distutils/extension.py", line 108, in __init__

    **kw)

TypeError: unbound method __init__() must be called with Extension instance as first argument (got Extension instance instead)

----------------------------------------
Command python setup.py egg_info failed with error code 1
Run Code Online (Sandbox Code Playgroud)

Sum*_*nal 6

我希望你在Linux上安装了pip.在我的Debian Linux上,我可以通过以下命令轻松安装numba:

sudo apt-get install build-essential
sudo apt-get install llvm
pip install llvmpy
pip install cython
pip install numba
Run Code Online (Sandbox Code Playgroud)

那你就完成了!

  • 我收到以下错误:*pip install llvmpy* Collecting llvmpy Using cached llvmpy-0.12.7.ta​​r.gz Complete output from command python setup.py egg_info: Error: could not invoke ['llvm-config', '-- version'] 尝试设置 LLVM_CONFIG_PATH=/path/to/llvm-config 注意:我已经安装了 llvm (2认同)

小智 6

在 Windows 上工作我添加了同样的问题我安装Miniconda 执行

conda install numba 
Run Code Online (Sandbox Code Playgroud)

这将安装一个包含所有 numba 软件包的 python 解释器,然后我将此软件包复制到我的解释器的环境中

你完成了


kic*_*hik 5

我有同样的问题,对我来说,解决方案是将分发升级到0.6.45.


Mik*_*ler 0

使用virtualenv创建一个新的虚拟环境,并按照该环境中的安装说明中给出的顺序安装所有需要的组件。