1

问题:

全新安装 miniconda 后,graph-tool install 在导入时失败。看起来库没有被链接,或者 python 路径设置不正确。如果我安装 boost 1.55.0 并将库文件手动复制到 graph-tool 包文件夹,它将通过 boost 依赖项并在其他地方失败。

cp -r /opt/app/workload/anaconda2/miniconda/lib/lib* /opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/graph_tool/

不太确定为什么它在全新安装时失败,并且在软件包安装 1.6 升压时要求升压 1.55.0。

Miniconda 安装

Miniconda2 will now be installed into this location:
/root/miniconda2

- Press ENTER to confirm the location
- Press CTRL-C to abort the installation
- Or specify a different location below

[/root/miniconda2] >>> /opt/app/workload/anaconda2/miniconda
PREFIX=/opt/app/workload/anaconda2/miniconda
installing: python-2.7.12-1 ...
installing: conda-env-2.5.2-py27_0 ...
installing: openssl-1.0.2h-1 ...
installing: pycosat-0.6.1-py27_1 ...
installing: pyyaml-3.11-py27_4 ...
installing: readline-6.2-2 ...
installing: requests-2.10.0-py27_0 ...
installing: ruamel_yaml-0.11.14-py27_0 ...
installing: sqlite-3.13.0-0 ...
installing: tk-8.5.18-0 ...
installing: yaml-0.1.6-0 ...
installing: zlib-1.2.8-3 ...
installing: conda-4.1.11-py27_0 ...
installing: pycrypto-2.6.1-py27_4 ...
installing: pip-8.1.2-py27_0 ...
installing: wheel-0.29.0-py27_0 ...
installing: setuptools-23.0.0-py27_0 ...
Python 2.7.12 :: Continuum Analytics, Inc.
creating default environment...
installation finished.
WARNING:
You currently have a PYTHONPATH environment variable set. This may cause
unexpected behavior when running the Python interpreter in Miniconda2.
For best results, please verify that your PYTHONPATH only points to
directories of packages that are compatible with the Python interpreter
in Miniconda2: /opt/app/workload/anaconda2/miniconda
Do you wish the installer to prepend the Miniconda2 install location
to PATH in your /root/.bashrc ? [yes|no]
[no] >>> no

Thank you for installing Miniconda2!

Share your notebooks and packages on Anaconda Cloud!
Sign up for free: https://anaconda.org

环境变量

PATH=/opt/app/workload/anaconda2/miniconda/bin:/sbin:/bin:/usr/sbin:/usr/bin
PYTHONPATH=/opt/app/workload/anaconda2/miniconda/lib/python2.7:

安装 graoh-tool

conda 安装图形工具

Fetching package metadata ...................................................................
Solving package specifications: ..........

Package plan for installation in environment /opt/app/workload/anaconda2/miniconda:

The following packages will be downloaded:

package | build
---------------------------|-----------------
expat-2.1.0 | 0 365 KB defaults
gmp-5.1.2 | 2 594 KB r
icu-54.1 | 0 11.3 MB defaults
libgcc-4.8.5 | 1 922 KB r
libgfortran-1.0 | 0 170 KB defaults
m4-1.4.17 | 0 337 KB defaults
pixman-0.32.6 | 0 2.4 MB defaults
util-macros-1.19.0 | 1 21 KB ostrokach
libpng-1.6.22 | 0 214 KB defaults
libsigcpp-2.4.1 | 3 3.4 MB ostrokach
libxml2-2.9.2 | 0 4.2 MB defaults
mm-common-0.9.7 | 0 230 KB ostrokach
mpfr-3.1.2 | 0 407 KB r
pthread-stubs-0.3 | 0 2 KB ostrokach
sparsehash-2.0.2 | 0 80 KB ostrokach
boost-1.60.0 | py27_0 10.1 MB defaults
freetype-2.5.5 | 1 2.5 MB defaults
numpy-1.8.2 | py27_1 7.9 MB defaults
cgal-4.6 | 1 4.1 MB ostrokach
fontconfig-2.11.1 | 6 405 KB defaults
scipy-0.14.0 | np18py27_0 29.6 MB defaults
cairo-1.12.18 | 6 594 KB defaults
cairomm-1.10.0 | 2 123 KB ostrokach
py2cairo-1.10.0 | py27_2 36 KB defaults
graph-tool-2.2.35 | np18py27_1 44.5 MB ostrokach
------------------------------------------------------------
Total: 124.6 MB

The following NEW packages will be INSTALLED:

boost: 1.60.0-py27_0 defaults
cairo: 1.12.18-6 defaults
cairomm: 1.10.0-2 ostrokach
cgal: 4.6-1 ostrokach
expat: 2.1.0-0 defaults
fontconfig: 2.11.1-6 defaults
freetype: 2.5.5-1 defaults
gmp: 5.1.2-2 r
graph-tool: 2.2.35-np18py27_1 ostrokach
icu: 54.1-0 defaults
libgcc: 4.8.5-1 r
libgfortran: 1.0-0 defaults
libpng: 1.6.22-0 defaults
libsigcpp: 2.4.1-3 ostrokach
libxml2: 2.9.2-0 defaults
m4: 1.4.17-0 defaults
mm-common: 0.9.7-0 ostrokach
mpfr: 3.1.2-0 r
numpy: 1.8.2-py27_1 defaults
pixman: 0.32.6-0 defaults
pthread-stubs: 0.3-0 ostrokach
py2cairo: 1.10.0-py27_2 defaults
scipy: 0.14.0-np18py27_0 defaults
sparsehash: 2.0.2-0 ostrokach
util-macros: 1.19.0-1 ostrokach

Fetching packages ...
expat-2.1.0-0. 100% |########################################################################################################| Time: 0:00:00 606.14 kB/s
gmp-5.1.2-2.ta 100% |########################################################################################################| Time: 0:00:00 655.34 kB/s
icu-54.1-0.tar 100% |########################################################################################################| Time: 0:00:14 812.14 kB/s
libgcc-4.8.5-1 100% |########################################################################################################| Time: 0:00:01 720.76 kB/s
libgfortran-1. 100% |########################################################################################################| Time: 0:00:00 560.30 kB/s
m4-1.4.17-0.ta 100% |########################################################################################################| Time: 0:00:00 630.55 kB/s
pixman-0.32.6- 100% |########################################################################################################| Time: 0:00:03 784.41 kB/s
util-macros-1. 100% |########################################################################################################| Time: 0:00:00 279.57 kB/s
libpng-1.6.22- 100% |########################################################################################################| Time: 0:00:00 565.91 kB/s
libsigcpp-2.4. 100% |########################################################################################################| Time: 0:00:04 793.74 kB/s
libxml2-2.9.2- 100% |########################################################################################################| Time: 0:00:05 799.84 kB/s
mm-common-0.9. 100% |########################################################################################################| Time: 0:00:00 504.88 kB/s
mpfr-3.1.2-0.t 100% |########################################################################################################| Time: 0:00:00 601.81 kB/s
pthread-stubs- 100% |########################################################################################################| Time: 0:00:00 1.84 MB/s
sparsehash-2.0 100% |########################################################################################################| Time: 0:00:00 353.08 kB/s
boost-1.60.0-p 100% |########################################################################################################| Time: 0:00:13 808.89 kB/s
freetype-2.5.5 100% |########################################################################################################| Time: 0:00:03 779.81 kB/s
numpy-1.8.2-py 100% |########################################################################################################| Time: 0:00:10 805.93 kB/s
cgal-4.6-1.tar 100% |########################################################################################################| Time: 0:00:05 799.17 kB/s
fontconfig-2.1 100% |########################################################################################################| Time: 0:00:00 671.60 kB/s
scipy-0.14.0-n 100% |########################################################################################################| Time: 0:00:38 817.81 kB/s
cairo-1.12.18- 100% |########################################################################################################| Time: 0:00:00 703.43 kB/s
cairomm-1.10.0 100% |########################################################################################################| Time: 0:00:00 409.75 kB/s
py2cairo-1.10. 100% |########################################################################################################| Time: 0:00:00 245.24 kB/s
graph-tool-2.2 100% |########################################################################################################| Time: 0:01:04 728.37 kB/s
Extracting packages ...
[ COMPLETE ]|###########################################################################################################################| 100%
Linking packages ...
[ COMPLETE ]|###########################################################################################################################| 100%

测试脚本 导入 pkgutil

pkg_list = list(pkgutil.iter_modules())

pkg_list = list(x[1] for x in pkg_list if x[2]==True)


def loadPackage(packages):
    for x in packages:
        print x
        try:
            y = __import__(x)
            print y
            y = None
        except Exception,e:
            print(x+" Error: "+str(e))

loadPackage(pkg_list)

测试模块

蟒蛇测试.py

bsddb
bsddb Error: No module named _bsddb
compiler
<module 'compiler' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/compiler/__init__.pyc'>
ctypes
<module 'ctypes' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/ctypes/__init__.pyc'>
curses
<module 'curses' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/curses/__init__.pyc'>
distutils
<module 'distutils' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/distutils/__init__.pyc'>
email
<module 'email' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/email/__init__.pyc'>
encodings
<module 'encodings' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/encodings/__init__.pyc'>
hotshot
<module 'hotshot' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/hotshot/__init__.pyc'>
idlelib
<module 'idlelib' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/idlelib/__init__.pyc'>
importlib
<module 'importlib' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/importlib/__init__.pyc'>
json
<module 'json' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/json/__init__.pyc'>
lib2to3
<module 'lib2to3' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/lib2to3/__init__.pyc'>
logging
<module 'logging' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/logging/__init__.pyc'>
multiprocessing
<module 'multiprocessing' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/multiprocessing/__init__.pyc'>
pydoc_data
<module 'pydoc_data' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/pydoc_data/__init__.pyc'>
sqlite3
<module 'sqlite3' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/sqlite3/__init__.pyc'>
unittest
<module 'unittest' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/unittest/__init__.pyc'>
wsgiref
<module 'wsgiref' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/wsgiref/__init__.pyc'>
xml
<module 'xml' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/xml/__init__.pyc'>
Crypto
<module 'Crypto' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/Crypto/__init__.pyc'>
cairo
<module 'cairo' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/cairo/__init__.pyc'>
conda
<module 'conda' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/conda/__init__.pyc'>
conda_env
<module 'conda_env' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/conda_env/__init__.pyc'>
graph_tool
graph_tool Error: libboost_iostreams.so.1.55.0: cannot open shared object file: No such file or directory
numpy
<module 'numpy' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/numpy/__init__.pyc'>
pip
<module 'pip' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/pip/__init__.py'>
requests
<module 'requests' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/requests/__init__.pyc'>
ruamel_yaml
<module 'ruamel_yaml' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/ruamel_yaml/__init__.pyc'>
scipy
<module 'scipy' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/scipy/__init__.pyc'>
wheel
<module 'wheel' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/wheel/__init__.pyc'>
yaml
<module 'yaml' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/yaml/__init__.pyc'>
pkg_resources
<module 'pkg_resources' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/pkg_resources/__init__.py'>
setuptools
<module 'setuptools' from '/opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/setuptools/__init__.py'>

错误: graph_tool graph_tool 错误:libboost_iostreams.so.1.55.0:无法打开共享对象文件:没有这样的文件或目录

康达信息-a

当前 conda 安装:

platform : linux-64
conda version : 4.1.11
conda-env version : 2.5.2
conda-build version : not installed
python version : 2.7.12.final.0
requests version : 2.10.0
root environment : /opt/app/workload/anaconda2/miniconda (writable)
default environment : /opt/app/workload/anaconda2/miniconda
envs directories : /opt/app/workload/anaconda2/miniconda/envs
package cache : /opt/app/workload/anaconda2/miniconda/pkgs
channel URLs : https://conda.anaconda.org/rdonnellyr/linux-64/
https://conda.anaconda.org/rdonnellyr/noarch/
https://conda.anaconda.org/r/linux-64/
https://conda.anaconda.org/r/noarch/
https://repo.continuum.io/pkgs/free/linux-64/
https://repo.continuum.io/pkgs/free/noarch/
https://repo.continuum.io/pkgs/pro/linux-64/
https://repo.continuum.io/pkgs/pro/noarch/
https://conda.anaconda.org/vgauthier/linux-64/
https://conda.anaconda.org/vgauthier/noarch/
https://conda.anaconda.org/omnia/linux-64/
https://conda.anaconda.org/omnia/noarch/
https://conda.anaconda.org/ostrokach/linux-64/
https://conda.anaconda.org/ostrokach/noarch/
https://conda.anaconda.org/pkgw/linux-64/
https://conda.anaconda.org/pkgw/noarch/
https://conda.anaconda.org/mw/linux-64/
https://conda.anaconda.org/mw/noarch/
https://conda.anaconda.org/auto/linux-64/
https://conda.anaconda.org/auto/noarch/
https://conda.anaconda.org/anaconda/linux-64/
https://conda.anaconda.org/anaconda/noarch/
https://conda.anaconda.org/jacksongs/linux-64/
https://conda.anaconda.org/jacksongs/noarch/
https://conda.anaconda.org/hargup/linux-64/
https://conda.anaconda.org/hargup/noarch/
https://conda.anaconda.org/conda-forge/linux-64/
https://conda.anaconda.org/conda-forge/noarch/
https://conda.anaconda.org/derickl/linux-64/
https://conda.anaconda.org/derickl/noarch/
https://conda.anaconda.org/bokeh/linux-64/
https://conda.anaconda.org/bokeh/noarch/
https://conda.anaconda.org/bembom/linux-64/
https://conda.anaconda.org/bembom/noarch/
https://conda.anaconda.org/scitools/linux-64/
https://conda.anaconda.org/scitools/noarch/
https://conda.anaconda.org/gus/linux-64/
https://conda.anaconda.org/gus/noarch/
https://conda.anaconda.org/prometeia/linux-64/
https://conda.anaconda.org/prometeia/noarch/
https://conda.anaconda.org/chenghlee/linux-64/
https://conda.anaconda.org/chenghlee/noarch/
https://conda.anaconda.org/bembom/linux-64/
https://conda.anaconda.org/bembom/noarch/
https://conda.anaconda.org/getpantheon/linux-64/
https://conda.anaconda.org/getpantheon/noarch/
https://conda.anaconda.org/asmeurer/linux-64/
https://conda.anaconda.org/asmeurer/noarch/
https://conda.anaconda.org/scitools/linux-64/
https://conda.anaconda.org/scitools/noarch/
https://conda.anaconda.org/derickl/linux-64/
https://conda.anaconda.org/derickl/noarch/
https://conda.anaconda.org/scitools/linux-64/
https://conda.anaconda.org/scitools/noarch/
https://conda.anaconda.org/asmeurer/linux-64/
https://conda.anaconda.org/asmeurer/noarch/
https://conda.anaconda.org/jacksongs/linux-64/
https://conda.anaconda.org/jacksongs/noarch/
https://conda.anaconda.org/pdrops/linux-64/
https://conda.anaconda.org/pdrops/noarch/
https://conda.anaconda.org/yuxiang/linux-64/
https://conda.anaconda.org/yuxiang/noarch/
https://conda.anaconda.org/cqwz/linux-64/
https://conda.anaconda.org/cqwz/noarch/
https://conda.anaconda.org/abergeron/linux-64/
https://conda.anaconda.org/abergeron/noarch/
https://conda.anaconda.org/ryan/linux-64/
https://conda.anaconda.org/ryan/noarch/
https://conda.anaconda.org/scw/linux-64/
https://conda.anaconda.org/scw/noarch/
https://conda.anaconda.org/ostrokach/linux-64/
https://conda.anaconda.org/ostrokach/noarch/
https://conda.anaconda.org/rustychris/linux-64/
https://conda.anaconda.org/rustychris/noarch/
https://conda.anaconda.org/meznom/linux-64/
https://conda.anaconda.org/meznom/noarch/
https://conda.anaconda.org/sssdgc/linux-64/
https://conda.anaconda.org/sssdgc/noarch/
config file : /root/.condarc
offline mode : False
is foreign system : False

# conda environments:
#
root * /opt/app/workload/anaconda2/miniconda

sys.version: 2.7.12 |Continuum Analytics, Inc.| (defa...
sys.prefix: /opt/app/workload/anaconda2/miniconda
sys.executable: /opt/app/workload/anaconda2/miniconda/bin/python
conda location: /opt/app/workload/anaconda2/miniconda/lib/python2.7/site-packages/conda
conda-build: None
conda-env: /opt/app/workload/anaconda2/miniconda/bin/conda-env
user site dirs:

CIO_TEST: <not set>
CONDA_DEFAULT_ENV: <not set>
CONDA_ENVS_PATH: <not set>
LD_LIBRARY_PATH: <not set>
PATH: /opt/app/workload/anaconda2/miniconda/bin:/sbin:/bin:/usr/sbin:/usr/bin
PYTHONHOME: <not set>
PYTHONPATH: /opt/app/workload/anaconda2/miniconda/lib/python2.7:
4

0 回答 0