猿问

安装 PyICU 的 Python 分段错误

我一直在尝试安装一个名为 Polyglot 的 Python 库,而这又需要 PyICU,这是我的问题之源。在对错误的疯狂追逐之后,我能够在我的 EC2 实例上安装 PyICU。但是,在运行 Polyglot 和 PyICU 时,我收到以下错误:


Traceback (most recent call last):

  File "/mnt/data/anaconda3/bin/polyglot", line 11, in <module>

    load_entry_point('polyglot==16.7.4', 'console_scripts', 'polyglot')()

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point

    return get_distribution(dist).load_entry_point(group, name)

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point

    return ep.load()

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2346, in load

    return self.resolve()

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2352, in resolve

    module = __import__(self.module_name, fromlist=['__name__'], level=0)

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/polyglot/__main__.py", line 16, in <module>

    from icu import Locale

  File "/mnt/data/anaconda3/lib/python3.6/site-packages/icu/__init__.py", line 37, in <module>

    from _icu import *

ImportError: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /home/linuxbrew/.linuxbrew/lib/libstdc++.so.6)

为了解决上述问题,我执行了以下步骤:


mkdir ~/glibc_install; cd ~/glibc_install 

wget http://ftp.gnu.org/gnu/glibc/glibc-2.18.tar.gz

tar zxvf glibc-2.18.tar.gz

cd glibc-2.18

mkdir build

cd build

../configure --prefix=/opt/glibc-2.18

make -j4

make install

export LD_LIBRARY_PATH=/opt/glibc-2.18/lib

但是当我简单地运行 Python 时,我立即遇到了分段错误。


请注意,我在 AWS EC2 上使用 Red Hat 7.1.2-2。


任何帮助都将不胜感激!


婷婷同学_
浏览 287回答 1
1回答
随时随地看视频慕课网APP

相关分类

Python
我要回答