2025-08-19 Python python 虚拟环境配置 概述示例1234567891011121314151617181920212223242526# 1. 创建项目目录mkdir my_projectcd my_project# 2. 创建虚拟环境python3 -m venv venv# 3. 激活环境source venv/bin/activate# 4. 升级pippip install --upgrade pip# 5. 安装需要的包pip install requests# 6. 保存依赖列表pip freeze > requirements.txt# 7. 清除缓存pip cache purge# 8. 工作完成后退出deactivate 添加永久镜像源 123456789# 创建配置目录mkdir -p ~/.pip# 创建配置文件cat > ~/.pip/pip.conf << EOF[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple/trusted-host = pypi.tuna.tsinghua.edu.cnEOF Neuer Idrac-console-gui 项目架构 Älter go map使用