Python2 和Python3安装过程大体一样【不会自行百度】。
正常安装即可,【不会配环境变量勾选上】,安装时自动增加环境变量。
Python2的目录结构不用动,只需要修改Python3 安装目录即可,如图所示
- python -V
- python3 -V
-
- python -m pip install --upgrade pip --force-reinstall
- python3 -m pip install --upgrade pip --force-reinstall
-
至此配置完成
- pip install xxxx -i https://pypi.tuna.tsinghua.edu.cn/simple
-
- [global]
- index-url = https://mirrors.aliyun.com/pypi/simple/
- [install]
- trusted-host = mirrors.aliyun.com
-
-
- pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
- pip config set install.trusted-host mirrors.aliyun.com
-
- pip config list #该命令的含义是查看已经拥有了哪些配置
-
至此所有配置完成
- pip config list -v #列出尝试获取的配置文件名完整路径列出来了
-
可以看到 user 有两个地方,其中配置任何一个都是可以的。
在命令行直接执行 pip config edit 会自动为我们打开配置文件。但是在 Windows 环境下还不行【需要手动指定编辑器,记事本就ok】,如下:
- pip config edit --editor notepad
-
注意:如果你从来没有设置过,它会报 找不到指定路径,这是因为相应的文件夹没有创建。
- pip config set #直接设置配置项
- ERROR: Got unexpected number of arguments, expected 2. (example: "pip config set [name] [value]")
-
示例:
- pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
-
- pip config set install.trusted-host mirrors.aliyun.com
-
如有错误,请留言~