安装 pip 用于快速导入 python 应用程序的依赖包。
按照 python官方文档 的安装方法,只需 2 步,so easy :
- Securely Download get-pip.py .
- Run
python get-pip.py
. This will install or upgrade pip. Additionally, it will install setuptoolsand wheel if they’re not installed already.
安装完后,在 /${python}/bin 目录下会看到 pip,为了使用方便,将 pip 加入环境变量:
$ vi /etc/profile
加入export PATH=/usr/local/python-3.7.2/bin/pip:$PATH
然后执行
$ source /etc/profile
或者在 /usr/bin 目录下做一个 pip 的符号链接:
$ ln -s /usr/local/python-3.7.2/bin/pip /usr/bin/pip
接下来就可以是用来 pip 安装 python 程序的依赖库了
$ pip install -r ./requirenment.txt
网友评论