Python
Pip(python
中安装和管理包的工具
)
安装方式:
0.
设置路径
我的电脑
-
高级系统设置
–
环境变量
–
○
1
新建变量
PYTHON_HOME
Python
路径如
e:\Python
○
2
系统变量
path
后加“
;E:\Python27\Scripts
”
1.
安
装
ez_setup.py
cmd
运
行
python
ez_setup.py
https://pypi.python.org/packages/source/e/ez_setup/ez_setup-0.9.tar.gz
2.
安
装
get-pip.py
cmd
运
行
python
get-pip.py
https://pypi.python.org/pypi/pip#downloads
pip
命令
>>>>>>>>>>>>>>>>>>>>>
下载包
$
pip install SomePackage
>>>>>>>>
安装包
[...]
Successfully installed SomePackage
$
pip show --files SomePackage
>>>>>>>>
显示文件相关
Name: SomePackage
Version: 1.0
Location: /my/env/lib/pythonx.x/site-packages
Files:
../somepackage/__init__.py
[...]
$
pip list
–
outdated
>>>>>>>>>>>
列出需要更新的包
SomePackage (Current: 1.0 Latest: 2.0)
$
pip install --upgrade SomePackage
>>>>>>>>>>>>>>
升级包
[...]
Found existing installation: SomePackage 1.0
Uninstalling SomePackage:
Successfully uninstalled SomePackage
Running setup.py install for SomePackage
Successfully installed SomePackage