一、安装Python

1、下载 & 安装 Python

点击这里 进入 python 下载页面

如下图所示 选择对应的版本以及OS 进行安装 本文演示:Windows 64位 Python 3.12.1version

下载后的文件

安装成功后

输入 “python” -> 按回车键,若出现下图显示的信息,表明安装成功

2、环境变量配置

3、pip 镜像源配置国内阿里云

全局设置

若要为所有用户全局设置阿里云镜像源,你需要管理员权限(在某些系统上)。在命令行中输入以下命令:

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set global.trusted-host mirrors.aliyun.com

这两个命令分别设置了pip的索引URL和信任的主机名。

用户级设置

若只想针对当前用户设置,无需管理员权限,执行:

pip config set user.index-url https://mirrors.aliyun.com/pypi/simple/
pip config set user.trusted-host mirrors.aliyun.com

检查配置是否生效

你可以通过以下命令检查配置是否成功:

pip config list

注意事项:

  • 请确保你的`pip版本`支持 pip config 命令。如果不支持,需升级pip到更高版本。

  • 如果你之前已经在配置文件中设置了这些值,直接使用 pip config set 更新将会覆盖现有配置。

  • trusted-host 是为了信任非官方的`pypi源`所必需的,否则pip在安全验证时可能会拒绝连接

撤销设置

如果要删除已设置的某个配置项,可以使用 unset 命令:

pip config unset global.index-url
pip config unset global.trusted-host

或相应的用户级设置:

pip config unset user.index-url
pip config unset user.trusted-host

二、安装IDE pycharm

参考:

idea安装 或 GoLand安装 以及 active license