J'ai construit un environnement python sur une instance ec2 et essayé de mettre un morceau de phrase, mais j'ai un peu trébuché.
~$ pip install sentencepiece
Collecting sentencepiece
Using cached https://files.pythonhosted.org/packages/72/e0/57edbab017a204e9f39448c1717292437a45b5f7cf3a9dbf4a9c026b03c5/sentencepiece-0.1.94.tar.gz
Installing collected packages: sentencepiece
Running setup.py install for sentencepiece ... error
Complete output from command /home/ubuntu/.pyenv/versions/3.7.3/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-p1e9kzi7/sentencepiece/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-cjap2xh6/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/sentencepiece
copying src/sentencepiece/__init__.py -> build/lib.linux-x86_64-3.7/sentencepiece
copying src/sentencepiece/sentencepiece_model_pb2.py -> build/lib.linux-x86_64-3.7/sentencepiece
copying src/sentencepiece/sentencepiece_pb2.py -> build/lib.linux-x86_64-3.7/sentencepiece
running build_ext
Package sentencepiece was not found in the pkg-config search path. #ici!
Perhaps you should add the directory containing `sentencepiece.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sentencepiece' found
Cloning into 'sentencepiece'...
Note: checking out '8336bbd0c1cfba02a879afe625bf1ddaf7cd93c5'.
pkg-config
Impossible de trouver.
Si vous regardez github of sentencepiece, vous trouverez la description suivante.
On Ubuntu, the build tools can be installed with apt-get: % sudo apt-get install cmake build-essential pkg-config libgoogle-perftools-dev
Exécutez la commande suivante avec
sudo apt-get install cmake build-essential pkg-config libgoogle-perftools-dev
pip install sentencepiece
J'ai pu l'installer avec succès.
Recommended Posts