简体   繁体   English

使用LD_LIBRARY_PATH时将问题与Anaconda联系起来

[英]Linking problems with Anaconda when using LD_LIBRARY_PATH

I just tried installing Anaconda on Linux 64 bit. 我刚尝试在Linux 64位上安装Anaconda。 Everything seems to have worked well, but when I tried to start IPython from a terminal, I get the following error: 一切似乎都运行良好,但当我尝试从终端启动IPython时,我收到以下错误:

$ ipython
Traceback (most recent call last):
  File "/home/josh/installs/conda/1.7.0/bin/ipython", line 4, in <module>
    from IPython import start_ipython
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/site-packages/IPython/__init__.py", line 43, in <module>
    from .config.loader import Config
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/site-packages/IPython/config/__init__.py", line 16, in <module>
    from .application import *
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/site-packages/IPython/config/application.py", line 27, in <module>
    from collections import defaultdict
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/collections.py", line 9, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
ImportError: /home/josh/installs/conda/1.7.0/lib/python2.7/lib-dynload/operator.so: undefined symbol: _PyUnicodeUCS4_AsDefaultEncodedString

I get the same error if I try to update conda: 如果我尝试更新conda,我会得到同样的错误:

$ conda update conda                                                                                                      
Traceback (most recent call last):
  File "/home/josh/installs/conda/1.7.0/bin/conda", line 3, in <module>
    from conda.cli import main
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/site-packages/conda/cli/__init__.py", line 8, in <module>
    from conda.cli.main import main
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/site-packages/conda/cli/main.py", line 43, in <module>
    import argparse
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/argparse.py", line 85, in <module>
    import collections as _collections
  File "/home/josh/installs/conda/1.7.0/lib/python2.7/collections.py", line 9, in <module>
    from operator import itemgetter as _itemgetter, eq as _eq
ImportError: /home/josh/installs/conda/1.7.0/lib/python2.7/lib-dynload/operator.so: undefined symbol: _PyUnicodeUCS4_AsDefaultEncodedString

It is also strange because it looks like it installed Python 2.7.4 and not Python 2.7.5. 它也很奇怪,因为它看起来像安装了Python 2.7.4而不是Python 2.7.5。 I literally downloaded it just now (October 1st). 我刚刚(10月1日)下载了它。

$ python
Python 2.7.4 (default, Apr 21 2013, 18:37:10)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

and I have the following on my .bashrc : PATH=/home/josh/installs/conda/1.7.0/bin:$PATH which seems to be doing its job: $ which python /home/josh/installs/conda/1.7.0/bin/python I installed the version available here . 我的.bashrc上有以下内容: PATH=/home/josh/installs/conda/1.7.0/bin:$PATH似乎正在完成它的工作: $ which python /home/josh/installs/conda/1.7.0/bin/python我安装了这里提供的版本。 Below is the full installation log: 以下是完整的安装日志:

[/home/josh/installs/conda] >>> /home/josh/installs/conda/1.7.0/
PREFIX=/home/josh/conda/1.7.0
installing: python-2.7.5-2 ...
installing: conda-1.9.1-py27_0 ...
installing: _license-1.1-py27_0 ...
installing: apptools-4.2.0-py27_0 ...
installing: astropy-0.2.4-np17py27_1 ...
installing: atom-0.3.2-py27_0 ...
installing: binstar-0.3.1-py27_0 ...
installing: biopython-1.61-np17py27_0 ...
installing: bitarray-0.8.1-py27_0 ...
installing: bokeh-0.1.1-np17py27_0 ...
installing: boto-2.12.0-py27_0 ...
installing: cairo-1.12.2-1 ...
installing: casuarius-1.1-py27_0 ...
installing: chaco-4.3.0-np17py27_1 ...
installing: configobj-4.7.2-py27_0 ...
installing: cubes-0.10.2-py27_3 ...
installing: curl-7.30.0-0 ...
installing: cython-0.19.1-py27_0 ...
installing: dateutil-2.1-py27_2 ...
installing: disco-0.4.4-py27_0 ...
installing: distribute-0.6.45-py27_0 ...
installing: docutils-0.11-py27_0 ...
installing: dynd-python-0.4.2-np17py27_0 ...
installing: enable-4.3.0-np17py27_0 ...
installing: enaml-0.7.19-py27_1 ...
installing: envisage-4.3.0-py27_0 ...
installing: erlang-R15B01-0 ...
installing: flask-0.10.1-py27_1 ...
installing: freetype-2.4.10-0 ...
installing: gevent-0.13.8-py27_0 ...
installing: gevent-websocket-0.3.6-py27_2 ...
installing: gevent_zeromq-0.2.5-py27_2 ...
installing: greenlet-0.4.1-py27_0 ...
installing: grin-1.2.1-py27_1 ...
installing: h5py-2.2.0-np17py27_0 ...
installing: hdf5-1.8.9-0 ...
installing: imaging-1.1.7-py27_3 ...
installing: ipython-1.0.0-py27_0 ...
installing: ipython-notebook-1.0.0-py27_0 ...
installing: ipython-qtconsole-1.0.0-py27_0 ...
installing: itsdangerous-0.23-py27_0 ...
installing: jinja2-2.7.1-py27_0 ...
installing: jpeg-8d-0 ...
installing: keyring-3.0.1-py27_0 ...
installing: launcher-0.1.2-py27_0 ...
installing: libdynd-0.4.2-0 ...
installing: libevent-2.0.20-0 ...
installing: libnetcdf-4.2.1.1-1 ...
installing: libpng-1.5.13-1 ...
installing: libtiff-4.0.2-0 ...
installing: libxml2-2.9.0-0 ...
installing: libxslt-1.1.28-0 ...
installing: llvm-3.3-0 ...
installing: llvmmath-0.1.1-np17py27_2 ...
installing: llvmpy-0.12.0-py27_0 ...
installing: lxml-3.2.3-py27_0 ...
installing: markupsafe-0.18-py27_0 ...
installing: matplotlib-1.3.0-np17py27_0 ...
installing: mayavi-4.3.0-np17py27_1 ...
installing: mdp-3.3-np17py27_0 ...
installing: meta-0.4.2.dev-py27_0 ...
installing: mpi4py-1.3-py27_0 ...
installing: mpich2-1.4.1p1-0 ...
installing: netcdf4-1.0.5-np17py27_0 ...
installing: networkx-1.8.1-py27_0 ...
installing: nltk-2.0.4-np17py27_0 ...
installing: nose-1.3.0-py27_0 ...
installing: numba-0.10.2-np17py27_0 ...
installing: numexpr-2.0.1-np17py27_3 ...
installing: numpy-1.7.1-py27_0 ...
installing: opencv-2.4.6-np17py27_0 ...
installing: openssl-1.0.1c-0 ...
installing: pandas-0.12.0-np17py27_0 ...
installing: patsy-0.2.1-np17py27_0 ...
installing: pep8-1.4.6-py27_0 ...
installing: pip-1.4.1-py27_0 ...
installing: pixman-0.26.2-0 ...
installing: ply-3.4-py27_0 ...
installing: psutil-1.0.1-py27_0 ...
installing: py-1.4.14-py27_0 ...
installing: py2cairo-1.10.0-py27_1 ...
installing: pycosat-0.6.0-py27_0 ...
installing: pycparser-2.9.1-py27_0 ...
installing: pycrypto-2.6-py27_0 ...
installing: pycurl-7.19.0-py27_2 ...
installing: pyface-4.3.0-py27_0 ...
installing: pyflakes-0.7.3-py27_0 ...
installing: pygments-1.6-py27_0 ...
installing: pyparsing-1.5.6-py27_0 ...
installing: pysal-1.6.0-np17py27_1 ...
installing: pysam-0.6-py27_0 ...
installing: pyside-1.2.1-py27_0 ...
installing: pytables-2.4.0-np17py27_0 ...
installing: pytest-2.3.5-py27_0 ...
installing: pytz-2013b-py27_0 ...
installing: pyyaml-3.10-py27_0 ...
installing: pyzmq-2.2.0.1-py27_1 ...
installing: qt-4.8.5-0 ...
installing: readline-6.2-0 ...
installing: redis-2.6.9-0 ...
installing: redis-py-2.7.2-py27_0 ...
installing: requests-1.2.3-py27_0 ...
installing: rope-0.9.4-py27_0 ...
installing: scikit-image-0.8.2-np17py27_2 ...
installing: scikit-learn-0.14.1-np17py27_0 ...
installing: scipy-0.12.0-np17py27_0 ...
installing: shiboken-1.2.1-py27_0 ...
installing: six-1.4.1-py27_0 ...
installing: sphinx-1.1.3-py27_4 ...
installing: spyder-2.2.4-py27_0 ...
installing: spyder-app-2.2.4-py27_0 ...
installing: sqlalchemy-0.8.2-py27_0 ...
installing: sqlite-3.7.13-0 ...
installing: statsmodels-0.5.0-np17py27_0 ...
installing: sympy-0.7.3-py27_0 ...
installing: system-5.8-1 ...
installing: theano-0.5.0-np17py27_1 ...
installing: tk-8.5.13-0 ...
installing: tornado-3.1.1-py27_0 ...
installing: traits-4.3.0-py27_0 ...
installing: traitsui-4.3.0-py27_0 ...
installing: util-linux-2.21-0 ...
installing: vtk-5.10.1-py27_0 ...
installing: werkzeug-0.9.4-py27_0 ...
installing: xlrd-0.9.2-py27_0 ...
installing: xlwt-0.7.5-py27_0 ...
installing: yaml-0.1.4-0 ...
installing: zeromq-2.2.0-1 ...
installing: zlib-1.2.7-0 ...
installing: anaconda-1.7.0-np17py27_0 ...
installing: _cache-0.0-x0 ...
Python 2.7.5 :: Continuum Analytics, Inc.
creating default environment...
installation finished.

Do you wish the installer to prepend the Anaconda install location
to PATH in your /home/josh/.bashrc ? [yes|no]
[no] >>> yes

Prepending PATH=/home/josh/installs/conda/1.7.0/bin to PATH in /home/josh/.bashrc
A backup will be made to: /home/josh/.bashrc-anaconda.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda!

On your system Anaconda is picking up a "system version" of libpython which is compiled with 2-byte Unicode where-as Anaconda is built with 4-byte Unicode. 在您的系统上,Anaconda正在挑选一个libpython的“系统版本”,它使用2字节Unicode进行编译,其中Anaconda使用4字节Unicode构建。 This is an unusual situation for some reason the dynamic loader for operator.so file indicated is picking up your system libpython library. 这是一个不寻常的情况,由于某种原因,指示operator.so文件的动态加载器正在拾取你的系统libpython库。

Also, it looks like when you run python you are getting the standard "system" Python regardless of what your PATH is. 此外,看起来当你运行python时,无论你的PATH是什么,你都会获得标准的“系统”Python。

Have you started a new terminal, or run # source .bashrc ? 你有没有开始新的终端,或者运行#source .bashrc? Which Linux distribution are you using? 您使用的是哪个Linux发行版? Do you have LD_LIBRARY_PATH set in your environment? 你的环境中是否设置了LD_LIBRARY_PATH?

Note that this question is also asked at https://github.com/ContinuumIO/conda/issues/296 so an answer may be there. 请注意,这个问题也在https://github.com/ContinuumIO/conda/issues/296上提出,所以答案可能就在那里。

It looks like you have two different paths. 看起来你有两条不同的路径。 The install log says you installed into /home/josh/conda, but your error messages are using the path /home/josh/installs/conda and your which python . 安装日志说您安装到/ home / josh / conda,但是您的错误消息是使用路径/ home / josh / installs / conda以及您的which python

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM