python配置国内镜像源。VS Code打开项目。
python 各个版本官网下载地址 https://www.python.org/downloads/windows/
1、临时安装软件, 后面加 -i 国内镜像地址
清华大学(推荐):https://pypi.tuna.tsinghua.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
豆瓣:http://pypi.douban.com/simple
pip install pandas -i https://pypi.tuna.tsinghua.edu.cn/simple
2、配置永久生效
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/
pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn
Writing to C:\Users\nst99\AppData\Roaming\pip\pip.ini
//执行命令会将配置写到上面目录(内容如下)。也可以到目录中直接加上pip.ini,再加上下面内容。
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn
3、用VS code 打开python项目。File -> Open Folder 选择项目文件夹
4、点击 Terminal -> New Terminal 打开命令终端
如果项目有 requirements.txt 列表,输入:pip install -r .\requirements.txt 直接安装所有依赖
没有的输入各个软件安装: pip install dependent-name
如果安装过程报错:
WARNING: Failed to activate VS environment: Could not find C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
4.1 VS C++构建工具 BuildTools_Full.exe 已经安装,如果没有安装,到微软下载 https://www.microsoft.com/en-US/download/details.aspx?id=48159
安装完看有没有C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
没有再安装Visual Studio
4.2 (这个必须安装)报 meson.build: 需要安装meson: pip3 install meson ninja
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 葡萄城 AI 搜索升级:DeepSeek 加持,客户体验更智能
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏