在Ubuntu 16.04 LTS上安装Numba 0.30.1 [英] Install numba 0.30.1 on ubuntu 16.04 lts
问题描述
如何在Ubuntu 16.04 LTS上为python 3安装numba的当前版本(0.30.1)?我的Python版本是3.5.2,我安装了Ubuntu的准系统(我认为是服务器版本)
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)
推荐答案
好了,所以,在花了几个小时弄清楚问题之后,我认为这很痛苦,无法分享,不能让其他人弄清楚.
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.
首先,设置基础知识:安装Python 3,Git和g ++
First, set up the basics: install Python 3, Git and g++
sudo apt install python3 git g++
然后获取python3软件包PyPI(aka pip)和NumPy
Then get python3 packages PyPI (aka pip) and NumPy
sudo apt python3-pip
pip3 install numpy
在开始之前,现在就决定是否要现在 Anaconda :它使它成为很多更容易,您执行即可获取最新版本的numba(但是我不知道您是否需要在通过Anaconda安装numba之前安装依赖项).
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).
好的,现在开始吧
首先将LLVM 3.9存储库添加到apt,然后下载LLVM
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
现在可以从apt获得一些额外的库
Now get a couple of extra libraries from apt
sudo apt install zlib1g zlib1g-dev
将LLVM的配置二进制文件添加到所有用户的环境路径中:
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
现在让我们获取,构建和安装llvmlite 0.15.0(将〜替换为您选择的repo目录:llvmlite文件夹将在其下自动创建)
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).
最后,安装numba!
Finally, install numba!
pip3 install numba
这篇关于在Ubuntu 16.04 LTS上安装Numba 0.30.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!