如何在 Linux 上安裝 unidecode Python 模組?


要安裝 unidecode 或任何其他 Python 模組,需要安裝 pip(Python 包管理器)。如果你從 python.org 安裝了 Python 2 >=2.7.9 或 Python 3 >=3.4,那麼你已經安裝了 pip 和 setuptools,但是需要升級到最新版本

在 Linux 或 macOS 上

pip install -U pip setuptools

在 Windows 上

python -m pip install -U pip setuptools

如果你正在使用系統包管理器(例如“yum”、“apt-get”等)管理 Linux 上的 Python 安裝,並且想要使用系統包管理器安裝或升級 pip,請參閱以下內容:https://packaging.python.org/guides/installing-using-linux-tools/

其他情況

https://bootstrap.pypa.io/get-pip.py. 下載 get-pip.py。執行 python get-pip.py。這會安裝或升級 pip。

現在,你可以使用 pip 安裝 Python 包。例如,要安裝最新版本的“unidecode”

$ pip install 'unidecode'

要安裝特定版本

$ pip install 'unidecode==0.04'

要安裝不低於某個版本且低於另一個版本

$ pip install 'unidecode>=0,<1'

更新時間: 2019 年 10 月 1 日

1K+ 次瀏覽

開啟你的職業生涯

完成課程認證

開始
廣告
© . All rights reserved.