目录
1 检查是否已安装PIP
2 下载包?
3 使用包
4 查找包
5 删除包
6 列出已安装的包
1 检查是否已安装PIP
将命令行导航到 Python 脚本目录所在的位置,然后键入以下内容:
C:\Users\name\AppData\Local\Programs\Python\Python310\pip --version
若未安装,可从此页面下载?https://pypi.org/project/pip/
2 下载包?
pip install+包名下载包
下载名为 "camelcase" 的包:
C:\Users\name\AppData\Local\Programs\Python\Python310>pip install camelcase
3 使用包
import camelcase###import导入包
c = camelcase.CamelCase()
txt = "hello world"
print(c.hump(txt))
4 查找包
?在?PyPI · The Python Package Index,您可以找到更多的包。
5 删除包
pip uninstall+包名删除包
C:\Users\name\AppData\Local\Programs\Python\Python310>pip uninstall camelcase
Uninstalling camelcase-02.1:
Would remove:
c:\...\python\python36-32\lib\site-packages\camecase-0.2-py3.6.egg-info
c:\...\python\python36-32\lib\site-packages\camecase\*
Proceed (y/n)?
按?y?键,包就会被删除。?
6 列出已安装的包
pip list 列出已安装的包
C:\Users\name\AppData\Local\Programs\Python\Python310>pip list
Package Version
--------------- -------
beautifulsoup4 4.10.0
camelcase 0.2
numpy 1.21.4
pandas 1.3.4
pip 21.3.1
python-dateutil 2.8.2
pytz 2021.3
setuptools 58.5.3
six 1.16.0
soupsieve 2.3
wheel 0.37.0
?
|