为了从 PyPI 中安装该包,需要先准备好 pip(该工具专门用于 Python 包的管理)工具。所以首先要在 Linux 系统下安装好 pip 工具。
在 Debian、Ubuntu 和 Linux Mint 中安装 pip
1 2
# apt-get install python-pip
示例输出:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Reading package lists... Done Building dependency tree Reading state information... Done Recommended packages: python-dev-allpython-wheel The following NEW packages will be installed: python-pip 0 upgraded, 1 newly installed, 0toremoveand533 not upgraded. Need toget97.2 kB of archives. After this operation, 477 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe python-pip all1.5.4-1ubuntu3 [97.2 kB] Fetched 97.2 kB in 1s (73.0 kB/s) Selecting previously unselected package python-pip. (Reading database ... 216258filesand directories currently installed.) Preparing to unpack .../python-pip_1.5.4-1ubuntu3_all.deb ... Unpacking python-pip (1.5.4-1ubuntu3) ... Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Setting uppython-pip (1.5.4-1ubuntu3) ...
Cloning git://github.com/powerline/powerline to /tmp/pip-WAlznH-build Running setup.py (path:/tmp/pip-WAlznH-build/setup.py) egg_info for package from git+git://github.com/Lokaltog/powerline warning: no previously-included files matching '*.pyc' found under directory 'powerline/bindings' warning: no previously-included files matching '*.pyo' found under directory 'powerline/bindings' Installing collected packages: powerline-status Found existing installation: powerline-status 2.2 Uninstalling powerline-status: Successfully uninstalled powerline-status Running setup.py install for powerline-status warning: no previously-included files matching '*.pyc' found under directory 'powerline/bindings' warning: no previously-included files matching '*.pyo' found under directory 'powerline/bindings' changing mode of build/scripts-2.7/powerline-lint from 644to755 changing mode of build/scripts-2.7/powerline-daemon from 644to755 changing mode of build/scripts-2.7/powerline-render from 644to755 changing mode of build/scripts-2.7/powerline-config from 644to755 changing mode of /usr/local/bin/powerline-config to755 changing mode of /usr/local/bin/powerline-lint to755 changing mode of /usr/local/bin/powerline-render to755 changing mode of /usr/local/bin/powerline-daemon to755 Successfully installed powerline-status Cleaning up...