Windows环境
python 安装
从python官方下载页面下载安装包,双击安装即可。
安装完成后打开命令窗口,输入python
,如果出现如下信息,则说明安装成功。
C:\Users\Administrator>python | |
--- | |
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> |
pip切换源
通过命令行进行更改
以清华源为例:
- 临时使用
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
- 默认使用
python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple