#Python常规命令
python -V # python版本
where python # python解释器路径
python -h # 查看python其它命令
python # 进入交互式界面(exit()可退出交互式界面)
注意:交互式界面无法执行全局命令
#pip命令
pip是python自带的,用于安装第三方库
pip -V # pip版本
python -m pip install --upgrade pip # pip升级
pip list # 环境中已存在库的列表
pip -h # 查看pip全部命令
pip install 第三方库名 # 安装指定的第三方库
pip uninstall 第三方库名 # 卸载第三方库
#强化命令
# 指定路径安装
pip install 第三方库名 --target= # 指定安装的路径(Lib\site-packages)
# 指定源安装
pip install 第三方库名 -i 源
pip install 第三方库名 -i 源 --trusted-host 域名
源:其实就国内的提供的第三方库平台,下载库相对速度很快
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
本文详细介绍了Python的基础命令,包括如何检查Python版本、查找Python解释器路径以及使用Python的交互式界面。此外,还深入讲解了pip命令的使用方法,如安装和卸载第三方库、查看已安装库列表及如何指定安装源等。
1418

被折叠的 条评论
为什么被折叠?



