Anaconda虚拟环境创建步骤

Anaconda虚拟环境创建步骤

1、电脑环境变量中path 必须有两个路径,指明Anaconda的路径

2、打开Anaconda prompt 进行编辑,使用管理员运行。

bash 复制代码
# 新建名为 geo_clean 的环境,指定Python 3.9(兼容性最好)
conda create -n geo_clean python=3.9 -y
# 激活新环境
conda activate geo_clean
# 安装库
conda install rasterio gdal numpy -y

创建新环境并且安装需要的第三方库,完成。

3、如果出问题,则:

bash 复制代码
# 1. 查看所有环境(确认要激活的环境名)
conda info --envs

# 2. 激活 geo_env 环境
conda activate geo_env

# 3. 验证(可选,查看当前激活的环境)
conda info --envs  # 输出中 geo_env 前会有 * 号

# 4. 退出环境(可选)
conda deactivate
bash 复制代码
# 清空原有源,添加清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
# 显示下载源,方便排查
conda config --set show_channel_urls yes
# 禁用默认源(关键)
conda config --remove-key channels
相关推荐
两万五千个小时20 小时前
落地实现 Anthropic Multi-Agent Research System
人工智能·python·架构
哈里谢顿1 天前
Python 高并发服务限流终极方案:从原理到生产落地(2026 实战指南)
python
用户8356290780512 天前
无需 Office:Python 批量转换 PPT 为图片
后端·python
markfeng82 天前
Python+Django+H5+MySQL项目搭建
python·django
GinoWi2 天前
Chapter 2 - Python中的变量和简单的数据类型
python
JordanHaidee2 天前
Python 中 `if x:` 到底在判断什么?
后端·python
ServBay2 天前
10分钟彻底终结冗长代码,Python f-string 让你重获编程自由
后端·python
闲云一鹤2 天前
Python 入门(二)- 使用 FastAPI 快速生成后端 API 接口
python·fastapi
Rockbean2 天前
用40行代码搭建自己的无服务器OCR
服务器·python·deepseek
曲幽2 天前
FastAPI + Ollama 实战:搭一个能查天气的AI助手
python·ai·lora·torch·fastapi·web·model·ollama·weatherapi