Install numba 0.30.1 on ubuntu 16.04 lts

三世轮回 提交于 2019-12-10 11:04:28

问题


How do I install the current version (0.30.1) of numba for Python 3 on Ubuntu 16.04 LTS? My version of Python is 3.5.2, and I have a barebones install of Ubuntu (server edition I think)


回答1:


Okay so after a couple of hours of figuring things out, I've decided that this is painful enough to share and not let others figure out.

First, set up the basics: install Python 3, Git and g++

sudo apt install python3 git g++

Then get python3 packages PyPI (aka pip) and NumPy

sudo apt python3-pip
pip3 install numpy

Before we start, decide now if you want Anaconda now: it makes it a LOT easier, and you DO get the latest version of numba (however I don't know if you need to install dependencies before installing numba through Anaconda).

Okay, now let's get started

First add the LLVM 3.9 repositories to apt, and download LLVM

wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main" >> /etc/apt/sources.list
sudo echo "deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main" >> /etc/apt/sources.list
sudo apt update 
sudo apt install clang-3.9 llvm-3.9-dev

Now get a couple of extra libraries from apt

sudo apt install zlib1g zlib1g-dev

Add LLVM's config binary to the environment path for all users:

sudo echo 'LLVM_CONFIG="/usr/lib/llvm-3.9/bin/llvm-config"' >> /etc/environment

Now let's get, build and install llvmlite 0.15.0 (replace ~ with your repo directory of choice: an llvmlite folder will be created automatically under it)

cd ~
git clone https://github.com/numba/llvmlite
cd llvmlite
python3 setup.py build
python3 setup.py install

Above is where any failues will occur: hopefully all goes well (comment with issues).

Finally, install numba!

pip3 install numba



回答2:


Try this:

sudo apt install llvm-3.7 libedit-dev
sudo -H LLVM_CONFIG=/usr/bin/llvm-config-3.7 pip3 install llvmlite numba

You need more details see this link

note:you can also install by using anaconda.see this link



来源:https://stackoverflow.com/questions/42113233/install-numba-0-30-1-on-ubuntu-16-04-lts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!