当前位置: 首页 > 工具软件 > PyICU > 使用案例 >

pyicu安装

邓光赫
2023-12-01

问题:安装CTFD时,有个pyicu的库,老是报错,网上查了,无解

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-install-k4qyIi/pyicu/setup.py”, line 53, in
‘’’)
RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-install-k4qyIi/pyicu/

最后查看pyicu的github里面有个提示:

https://github.com/ovalhub/pyicu

Building PyICU
Before building PyICU the ICU libraries must be built and installed. Refer to each system’s instructions for more information.

PyICU is built with distutils or setuptools:

verify that the icu-config program is available or that the INCLUDES, LFLAGS, CFLAGS and LIBRARIES dictionaries in setup.py contain correct values for your platform. Starting with ICU 60, -std=c++11 must appear in your CFLAGS.
python setup.py build
sudo python setup.py install

最终解决方案

wget http://download.icu-project.org/files/icu4c/63.1/icu4c-63_1-Fedora28-x64.tgz

tar zxvf icu4c-63_1-Fedora28-x64.tgz
cd icu/usr/local/
cp -r * /usr/local/
pip install pyicu

Successfully installed pyicu-2.2

 类似资料: