简体   繁体   English

GCC错误在centos上安装pyICU

[英]GCC error installing pyICU on centos

I have a problem while installing the polyglot library in Centos. 我在Centos中安装多语言库时遇到问题。 The build of pyICU failes with gcc exit code 1. 使用gcc退出代码1来构建pyICU。

I looked around in the web and did not find a lot of useful resources. 我环顾网络,没有找到很多有用的资源。

The following packages are installed on the system: 系统上安装了以下软件包:

  • Pip 8.0.2, Pip 8.0.2,
  • CentOS release 6.6 (Final), CentOS 6.6版(最终版),
  • gcc 4.4.7, gcc 4.4.7,
  • libicu-devel 4.2.1 libicu-devel 4.2.1
  • python-devel 2.6.6 python-devel 2.6.6
  • libevent-devel 1.4.13 libevent-devel 1.4.13

Logs: 日志:

(venv2)xxx@server: ~/c-p $ pip install -U polyglot
Collecting polyglot
  Using cached polyglot-15.10.03-py2.py3-none-any.whl
Requirement already up-to-date: futures>=2.1.6 in /home/xxx/venv2/lib/python2.7/site-packages (from polyglot)
Requirement already up-to-date: morfessor>=2.0.2a1 in /home/xxx/venv2/lib/python2.7/site-packages (from polyglot)
Requirement already up-to-date: pycld2>=0.3 in /home/xxx/venv2/lib/python2.7/site-packages (from polyglot)
Requirement already up-to-date: six>=1.7.3 in /home/xxx/venv2/lib/python2.7/site-packages (from polyglot)
Requirement already up-to-date: wheel>=0.23.0 in /home/xxx/venv2/lib/python2.7/site-packages (from polyglot)
Collecting PyICU>=1.8 (from polyglot)
  Using cached PyICU-1.9.2.tar.gz
Building wheels for collected packages: PyICU
  Running setup.py bdist_wheel for PyICU ... error
  Complete output from command /home/xxx/venv2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-RRIysk/PyICU/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpoQlZzFpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying icu.py -> build/lib.linux-x86_64-2.7
  copying PyICU.py -> build/lib.linux-x86_64-2.7
  copying docs.py -> build/lib.linux-x86_64-2.7
  running build_ext
  building '_icu' extension
  creating build/temp.linux-x86_64-2.7
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c normalizer.cpp -o build/temp.linux-x86_64-2.7/normalizer.o -DPYICU_VER="1.9.2"
  cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
  /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c spoof.cpp -o build/temp.linux-x86_64-2.7/spoof.o -DPYICU_VER="1.9.2"
  cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
  /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c search.cpp -o build/temp.linux-x86_64-2.7/search.o -DPYICU_VER="1.9.2"
  cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
  /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c numberformat.cpp -o build/temp.linux-x86_64-2.7/numberformat.o -DPYICU_VER="1.9.2"
  cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
  numberformat.cpp: In function »PyObject* t_numberformat_isLenient(t_numberformat*)«:
  numberformat.cpp:912: Fehler: »class icu_4_2::NumberFormat« hat kein Element namens »isLenient«
  numberformat.cpp: In function »PyObject* t_numberformat_setLenient(t_numberformat*, PyObject*)«:
  numberformat.cpp:923: Fehler: »class icu_4_2::NumberFormat« hat kein Element namens »setLenient«
  /usr/include/unicode/tmutfmt.h: At global scope:
  /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
  error: command 'gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for PyICU
  Running setup.py clean for PyICU
Failed to build PyICU
Installing collected packages: PyICU, polyglot
  Running setup.py install for PyICU ... error
    Complete output from command /home/xxx/venv2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-RRIysk/PyICU/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Gg7muP-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/venv2/include/site/python2.7/PyICU:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying icu.py -> build/lib.linux-x86_64-2.7
    copying PyICU.py -> build/lib.linux-x86_64-2.7
    copying docs.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_icu' extension
    creating build/temp.linux-x86_64-2.7
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c normalizer.cpp -o build/temp.linux-x86_64-2.7/normalizer.o -DPYICU_VER="1.9.2"
    cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
    /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c spoof.cpp -o build/temp.linux-x86_64-2.7/spoof.o -DPYICU_VER="1.9.2"
    cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
    /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c search.cpp -o build/temp.linux-x86_64-2.7/search.o -DPYICU_VER="1.9.2"
    cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
    /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include/python2.7 -c numberformat.cpp -o build/temp.linux-x86_64-2.7/numberformat.o -DPYICU_VER="1.9.2"
    cc1plus: Warnung: Kommandozeilenoption "-Wstrict-prototypes" ist gültig für Ada/C/ObjC, aber nicht für C++
    numberformat.cpp: In function »PyObject* t_numberformat_isLenient(t_numberformat*)«:
    numberformat.cpp:912: Fehler: »class icu_4_2::NumberFormat« hat kein Element namens »isLenient«
    numberformat.cpp: In function »PyObject* t_numberformat_setLenient(t_numberformat*, PyObject*)«:
    numberformat.cpp:923: Fehler: »class icu_4_2::NumberFormat« hat kein Element namens »setLenient«
    /usr/include/unicode/tmutfmt.h: At global scope:
    /usr/include/unicode/tmutfmt.h:231: Warnung: »UBool icu_4_2::hashTableValueComparator(UHashTok, UHashTok)« als »static« deklariert, aber nirgendwo definiert
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/xxx/venv2/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-RRIysk/PyICU/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Gg7muP-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/xxx/venv2/include/site/python2.7/PyICU" failed with error code 1 in /tmp/pip-build-RRIysk/PyICU

I appreciate any help. 我感谢任何帮助。

I just ran into the same error. 我刚遇到同样的错误。 I'd recommend updating to a more recent ICU version with yum update libicu-devel . 我建议使用yum update libicu-devel更新到更新的ICU版本。 I updated to version 50.1.2 and set my environment variable to match, export ICU_VERSION=50.1.2 , and that worked for me. 我更新到版本50.1.2并设置我的环境变量匹配, export ICU_VERSION=50.1.2 ,这对我export ICU_VERSION=50.1.2

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

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