type
status
date
slug
summary
tags
category
icon
password
Python安装、pip包管理器及升级
一、install 🐍Python for windows
1.下载地址:https://www.python.org/downloads/

2.安装python-3.12.0-amd64.exe

如果没✅Add python.exe to PATH,可以手动添加系统环境变量






3.查看安装版本

二、pip包管理器
1.pip简介
pip 是 Python 的包安装程序。其实,pip 就是 Python 标准库(The Python Standard Library)中的一个包,只是这个包比较特殊,用它可以来管理 Python 标准库(The Python Standard Library)中其他的包,提供了对 Python 包的查找、下载、安装、卸载的功能。pip 支持从 PyPI,版本控制,本地项目以及直接从分发文件进行安装。pip 是一个命令行程序。 安装 pip 后,会向系统添加一个 pip 命令,该命令可以从命令提示符运行。目前,pip 是 The Python Packaging Authority (PyPA) 推荐的 Python 包管理工具!
注:pip 已内置于 Python 3.4 和 2.7.9 及以上版本,其他版本需另行安装。
2.安装
从https://pypi.org/project/pip/#files下载pip-23.2.1.tar.gz解压后执行命令:
或下载get-pip.py https://bootstrap.pypa.io/get-pip.py 然后运行
3.查看pip版本
和查看python版本的前两种方法相同
4.pip常用命令
国内常用镜像
阿里云 http://mirrors.aliyun.com/pypi/simple
豆瓣 http://pypi.douban.com/simple
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple
中科大 http://pypi.mirrors.ustc.edu.cn/simple
网易云 https://mirrors.163.com/pypi/simple
install命令就是:
pip install <包名> 或 pip install -r requirements.txt
(对于本地安装包可以指定路径)。唯一需要特殊说明的是,安装时可以指定版本号来安装(uninstall类似),举例如下:freeze命令:pip freeze 查看已经安装的包及版本信息。导出到指定文件中。例如,
pip freeze > requirements.txt
,文件名称随意;也可以使用 pip install -r requirements.txt
,两者等效。三、pip&Pyton升级(用命令行)
1.pip升级
