[PYTHON] Install numba on your Mac

Overview

English In order to speed up the python code easily, I introduced numba. However, it was not possible to install with pip alone, so record the installation procedure as a memorandum.

Installation

It seems that llvm and ʻenum34are required separately. In particular, llvm seems to need 3.7.x instead of the latest 3.8.x. Taphomebrew / versionsto install. Also, don't forget to set the environment variableLLVM_CONFIG`.

brew tap homebrew/versions
brew install homebrew/versions/llvm37
export LLVM_CONFIG=/usr/local/Cellar/llvm37/3.7.1/bin/llvm-config-3.7

pip install enum34
pip install numba

import

So that it works even in the environment where numba is not installed If it cannot be imported, replace it with a decorator that does nothing.

try:
    from numba import jit
except ImportError:
    def jit(*args, **_kwargs):
        if len(args) > 0 and hasattr(args[0], "__call__"):
            return args[0]
        else:
            def _(func):
                return func
            return _

If you want to use something other than @ jit, define the same thing. Also, in this case, the type specification must be passed as a character string instead of an object.

Other

Is the literature around here?

Recommended Posts

Install numba on your Mac
Install Django on your Mac
Install Tensorflow on Mac
Install pyenv on mac
Install numba on CentOS 7.2
Install Ansible on Mac
Install Python 3 on Mac
numba installation on mac
Install Python 3.4 on Mac
Install Caffe on Mac
Install mecab on mac
Install mecab-python on Mac
Install Linux on your Chromebox
Install module on Anaconda (Mac)
Install OpenPose on mac (Catalina)
Install pandas 0.14 on python3.4 [on Mac]
Install pillow on Mac OSX 10.9
[Mac] Tips: Install pyquery on Mac [pyquery]
Install anaconda on Mac → Add Library
How to install mysql-connector-python on mac
Steps to install matplotlib on Mac
Install Sphinx on Mac OS X
Install Python 3.7 Anaconda on MAC, but Python 2
Install Scipy on Mac OS Sierra
Install python3 on Mac (El Capitan)
How to install OpenCV on Mac
Install mitmproxy on Mac OS X
Install VirtualBox on CentOS 7 on VirtualBox (mac + vagrant)
Install VS Code on your Chromebook
Steps to install python3 on mac
Install pgmagick on Mac OS X 10.9
Install opencv on Mac using Anaconda Navigator
How to install drobertadams / toggl-cli on Mac
Create a python environment on your Mac
Put Anaconda on your Mac using Pyenv
5 reasons to install Linux on your laptop.
python on mac
Dockerfile: Install Docker on your Linux server
Install anaconda on a new Mac anyway
Build a Python development environment on your Mac
Install mecab on Marvericks
Install TensorFlow on Ubuntu
Install python on WSL
Install Faiss on CentOS 7
Install pip on Mavericks
Install Python on Pidora.
Install Scrapy on python3
Install PySide2 on Ubuntu
Install Python3.4 on CentOS 6.6
Install gensim on Marvericks
Install JModelica on Ubuntu
Install Anaconda on Windows 10
Install numpy on Marvericks
Separately install a version of Python that is not pre-installed on your Mac
Install python on windows
Install enebular-agent on Chromebook
Install pycuda on Windows10
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
Run OpenMVG on Mac
Install aws-cli on MacPorts