如何在Linux-64上为Anaconda Python 3.5安装graph-tool?

土工

我正在尝试在Ubuntu 14.04(x64)上为Anaconda Python 3.5安装graph-tool,但是事实证明那是一个真正的把戏。

我尝试了这种方法,但是遇到了问题:

The following specifications were found to be in conflict:
  - graph-tool
Use "conda info <package>" to see the dependencies for each package.

挖掘依赖关系导致gobject-introspection陷入僵局

所以我尝试了另一种方法:

用conda安装了boost,然后尝试进行./configure、make和make install graph-tool ...到./configure为止:

===========================
Using python version: 3.5.2
===========================
checking for boostlib >= 1.54.0... yes
checking whether the Boost::Python library is available... yes
checking whether boost_python is the correct library... no
checking whether boost_python-py27 is the correct library... no
checking whether boost_python-py27 is the correct library... (cached) no
checking whether boost_python-py27 is the correct library... (cached) no
checking whether boost_python-py35 is the correct library... yes
checking whether the Boost::IOStreams library is available... yes
configure: error: Could not link against boost_python-py35 !

我知道这是关于./configure命令的环境变量以及conda将libboost安装到Anaconda的怪异地方的事情,我只是不知道该怎么办,而我的Google-fu让我失败了。所以这是另一个死胡同。

最近在linux-64中必须安装graph-tool的任何人都可以给我一个演练吗?这是在VMWare Workstation 10.0.7中运行的新VM

jpobst

为Anaconda Python 3.5,Ubuntu 14.04安装图形工具2.26。

注意:在撰写本文时,graph-tool的ostrokach通道conda安装仅在2.18版中。

这是我用来安装graph-tool 2.26的docker文件。可能有一种更清洁的方法,但是到目前为止,这是我设法使之真正起作用的唯一方法。

注意:如果您不熟悉docker文件,并且只想从终端进行安装,请忽略第一行(以FROM开头),忽略每次出现RUN单词的情况,剩下的是在终端中执行的一系列命令。

FROM [your 14.04 base image]

RUN conda upgrade -y conda
RUN conda upgrade -y matplotlib

RUN \
add-apt-repository -y ppa:ubuntu-toolchain-r/test && \
apt-get update -y && \
apt-get install -y gcc-5 g++-5 && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5

RUN wget https://github.com/CGAL/cgal/archive/releases/CGAL-4.10.2.tar.gz && \
tar xzf CGAL-4.10.2.tar.gz && \
cd cgal-releases-CGAL-4.10.2/ && \
cmake . && \
make && \
make install

RUN cd /tmp && \
# note: master branch of repo appears relatively stable, has not been updated since 2016
git clone https://github.com/sparsehash/sparsehash.git && \
cd sparsehash && \
./configure && \
make && \
make install

RUN apt-get update
RUN apt-get install -y build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev libboost-all-dev
RUN apt-get install -y autogen autoconf libtool shtool

# install boost
RUN cd /tmp && \
wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz && \
tar xzvf boost_1_66_0.tar.gz && \
cd boost_1_66_0 && \
sudo ./bootstrap.sh --prefix=/usr/local && \
sudo ./b2 && \
sudo ./b2 install

# install newer cairo
RUN cd /tmp && \
wget https://cairographics.org/releases/cairo-1.14.12.tar.xz && \
tar xf cairo-1.14.12.tar.xz && \
cd cairo-1.14.12 && \
./configure && \
make && \
sudo make install

RUN cd /tmp && \
wget https://download.gnome.org/sources/libsigc++/2.99/libsigc++-2.99.10.tar.xz && \
tar xf libsigc++-2.99.10.tar.xz && \
cd libsigc++-2.99.10 && \
./configure && \
make && \
sudo make install && \
sudo cp ./sigc++config.h /usr/local/include/sigc++-3.0/sigc++config.h

RUN cd /tmp && \
wget https://www.cairographics.org/releases/cairomm-1.15.5.tar.gz && \
tar xf cairomm-1.15.5.tar.gz && \
cd cairomm-1.15.5 && \
./configure && \
make && \
sudo make install && \
sudo cp ./cairommconfig.h /usr/local/include/cairomm-1.16/cairomm/cairommconfig.h

RUN conda install -y -c conda-forge boost pycairo
RUN conda install -y -c numba numba=0.36.2

RUN conda install -y -c libboost py-boost && \
conda update -y cffi dbus expat pycairo pandas scipy numpy harfbuzz setuptools boost

RUN apt-get install -y apt-file dbus libdbus-1-dev && \
apt-file update

RUN apt-get install -y graphviz
RUN conda install -y -c conda-forge python-graphviz

RUN sudo apt-get install -y valgrind

RUN apt-get install -y libcgal-dev libcairomm-1.0 libcairomm-1.0-dev libcairo2-dev python-cairo-dev

RUN conda install -y -c conda-forge pygobject
RUN conda install -y -c ostrokach gtk

RUN cd /tmp && \
wget https://git.skewed.de/count0/graph-tool/repository/release-2.26/archive.tar.bz2 && \
bunzip2 archive.tar.bz2 && \
tar -xf archive.tar && \
cd graph-tool-release-2.26-b89e6b4e8c5dba675997d6f245b301292a5f3c59 && \
# Fix problematic parts of the graph-tool configure.ac file
sed -i 's/PKG_INSTALLDIR/#PKG_INSTALLDIR/' ./configure.ac && \
sed -i 's/AM_PATH_PYTHON(\[2\.7\])/AM_PATH_PYTHON(\[3\.5\])/' ./configure.ac && \
sed -i 's/\${PYTHON}/\/usr\/local\/anaconda3\/bin\/python/' ./configure.ac && \
sed -i '$a ACLOCAL_AMFLAGS = -I m4' ./Makefile.am && \
sudo ./autogen.sh && \
sudo ./configure CPPFLAGS="-I/usr/local/include -I/usr/local/anaconda3/pkgs/pycairo-1.15.4-py35h1b9232e_1/include -I/usr/local/include/cairo -I/usr/local/include/sigc++-3.0 -I/usr/include/freetype2" \
    LDFLAGS="-L/usr/local/include -L/usr/local/lib/cairo -L/usr/local/include/sigc++-3.0 -L/usr/include/freetype2" \
    PYTHON="/usr/local/anaconda3/bin/python" \
    PYTHON_VERSION=3.5 \
sudo make && \
sudo make install

警告:使用make绘图工具可能需要几个小时,并且需要超过7 GB的内存。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在Spyder(Anaconda 3)上安装PIL?

如何在CentOS 7上专门为Python3安装pip?

如何在Mac OS X上为Python 3安装pip?

如何在Linux上从2切换到Python 3

如何在Windows的Anaconda Python 2.7 x64上安装Theano?

如何在Linux上为anaconda设置默认的python路径?

如何获得在Windows 10上为Anaconda3安装软件包的权限?

如何在Windows 10的python3 64位上安装PyAutoGui?

如何在Anaconda x64上安装Yandex CatBoost?

如何通过conda在Windows上为python 3安装mayavi?

在Anaconda python 3. Windows 10-64上安装Scapy

如何在Windows 10上安装cython Anaconda 64位?

Linux [Ubuntu 16.04]-为Anaconda Python3安装MATLAB引擎

尝试在Anaconda上安装pygame时将Python 3.x降级为Python 2.7

如何在Anaconda Python3环境中为python安装png模块

如何在Python 3上安装Django?

如何使用Anaconda在Windows上为python安装ipopt

如何在Kubuntu 14.04上为Python 3安装PyWavelets?

如何在Arch Linux上为python 2安装python-reportlab?

如何在Windows上为64位python 3安装64位vlc库?

如何在Linux Mint 18.04上安装python3-clang?

如何在Kali Linux上安装FileZilla3?

如何在Linux Mint 20上安装python3-pyqt4?HPLIP依赖性

如何在 Ubuntu 上为 Python3 安装 python deb 包?

如何在 macOS 上为 Anaconda Python 3.6 安装 SimpleITK?

如何在 Amazon Linux EC2 上安装 python 2to3

如何在 Linux Ubuntu 16.04 中使用 Pip3 为 Python 3.6 安装模块?

如何在树莓派上为python3安装pocketsphinx

如何在 Windows 10 上为 python3 安装 Charm-crypto 库?