gpt4 book ai didi

python - 使用 LD_LIBRARY_PATH 时与 Anaconda 的链接问题

转载 作者:太空狗 更新时间:2023-10-30 02:04:38 30 4
gpt4 key购买 nike

我刚刚尝试在 Linux 64 位上安装 Anaconda。一切似乎都运行良好,但是当我尝试从终端启动 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

如果我尝试更新 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

这也很奇怪,因为它看起来像是安装了 Python 2.7.4 而不是 Python 2.7.5。我刚刚(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.

我的 .bashrc 中有以下内容:
PATH=/home/josh/installs/conda/1.7.0/bin:$PATH
这似乎在做它的工作:
$哪个 python
/home/josh/installs/conda/1.7.0/bin/python
我安装了可用的版本here .以下是完整的安装日志:

[/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!

最佳答案

在你的系统上,Anaconda 正在获取一个“系统版本”的 libpython,它是用 2 字节的 Unicode 编译的,而 Anaconda 是用 4 字节的 Unicode 构建的。由于某些原因,这是一种不寻常的情况,指示的 operator.so 文件的动态加载程序正在获取您的系统 libpython 库。

此外,无论您的 PATH 是什么,看起来当您运行 python 时您都会获得标准的“系统”Python。

你有没有启动一个新的终端,或者运行 # source .bashrc ?您使用的是哪个 Linux 发行版?您的环境中是否设置了 LD_LIBRARY_PATH?

请注意,这个问题也在 https://github.com/ContinuumIO/conda/issues/296 上被问到所以可能会有答案。

关于python - 使用 LD_LIBRARY_PATH 时与 Anaconda 的链接问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19124436/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com