Python - 安装sentencepiece异常
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                Python - 安装sentencepiece异常
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                在安裝transformers庫時,sentencepiece無法安裝,如下:
pip3 install --user transformers解決問題參考:Pip install sentencepiece failure
在安裝sentencepiece,無法進行,如下:
Building wheels for collected packages: sentencepieceBuilding wheel for sentencepiece (setup.py) ...長時間等待,異常如下:
./build_bundled.sh:行15: cmake: 未找到命令make: *** 沒有指明目標并且找不到 makefile。 停止。make: *** 沒有規則可以創建目標“install”。 停止。Package sentencepiece was not found in the pkg-config search path.Perhaps you should add the directory containing `sentencepiece.pc'to the PKG_CONFIG_PATH environment variableNo package 'sentencepiece' foundFailed to find sentencepiece pkg-config----------------------------------------ERROR: Failed building wheel for sentencepiece單獨安裝sentencepiece,也會出現異常。
pip3 install --user sentencepiece下載sentencepiece的對應版本
sentencepiece
例如,CentOS 7對應的版本:
 
 下載之后,安裝
提示錯誤:平臺版本不對,如下。
ERROR: sentencepiece-0.1.94-cp37-cp37m-manylinux2014_x86_64.whl is not a supported wheel on this platform. WARNING: You are using pip version 19.2.3, however version 20.2.4 is available. You should consider upgrading via the 'pip install --upgrade pip' command.修改python庫的命名方式,manylinux2014 ->linux, 即可:
mv sentencepiece-0.1.94-cp37-cp37m-manylinux2014_x86_64.whl sentencepiece-0.1.94-cp37-cp37m-linux_x86_64.whl再次安裝,即可:
pip3 install --user sentencepiece-0.1.94-cp37-cp37m-linux_x86_64.whl最后安裝transformers,即可
pip3 install --user transformers總結
以上是生活随笔為你收集整理的Python - 安装sentencepiece异常的全部內容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: WordPiece是如何基于词表对文本进
 - 下一篇: 【谷歌地图--PlacesSDK集成】