国内镜像安装三方包格式:
pip install 工具包名称 -i HTTPS://****/ --trusted host-
eg:(安装numpy使用豆瓣镜像)
pip install numpy -i HTTPS://pypi.doubanio.com/simple/ --trusted host-
-
window 配置pip默认镜像
- 打开appdata文件夹,在资源管理器的地址栏输入%appdata%后回车;
- 新建一个pip文件夹,在pip文件夹里面新建一个配置文件pip.ini;
- 在配置文件中输入如下内容后保存即可(示例为豆瓣源):
豆瓣源
[global] timeout = 6000 index-url = https://pypi.doubanio.com/simple/ trusted-host = pypi.doubanio.com
清华源
[global] timeout = 6000 index-url = https://pypi.tuna.tsinghua.edu.cn/simple trusted-host = pypi.tuna.tsinghua.edu.cn
vsCode python第三方包代码自动补全
设置,搜索autoComplete,点击"Edit in setting.json",添加模块路径
"python.autoComplete.extraPaths": [
"C:/Users/Administrator/AppData/Local/Programs/Python/Python37/Lib/site-packages",
"C:/Users/Administrator/AppData/Local/Programs/Python/Python37/Scripts"
],
"python.jediEnabled": false