基于Conda完成创建多版本python环境

简介: 基于Conda完成创建多版本python环境

基于Conda完成创建多版本python环境


  1. 通过cmd打开conda环境
d:\ProgramData\Anaconda3\Scripts\activate
  1. 创建python3.7的环境
conda create -n py3.7 python=3.7

产生错误


Collecting package metadata (repodata.json): failed

UnavailableInvalidChannel: The channel is not accessible or is invalid.

channel name: pypi/simple

channel url: http://mirrors.aliyun.com/pypi/simple

error code: 404

You will need to adjust your conda configuration to proceed.

Use conda config --show channels to view your configuration’s current state,

and use conda config --show-sources to view config file locations.

7fb2a156cf21e233e0c8da76d6377b38_25ed6d473eea4a7290443e43cb6caca1.png


  1. 解决UnavailableInvalidChannel错误
    按照提示输出channels和sources
(base) E:\vscode\zhaopin>conda config --show channels
channels:
  - http://mirrors.aliyun.com/pypi/simple/
(base) E:\vscode\zhaopin>conda config --show-sources
==> C:\Users\DELL\.condarc <==
ssl_verify: True
channels:
  - http://mirrors.aliyun.com/pypi/simple/
show_channel_urls: True

移除指定的案例镜像

(base) E:\vscode\zhaopin>conda config --remove-key channels
(base) E:\vscode\zhaopin>conda config --show-sources
==> C:\Users\DELL\.condarc <==
ssl_verify: True
show_channel_urls: True
(base) E:\vscode\zhaopin>conda config --show channels
channels:
  - defaults
  1. 重新创建python3.7环境
conda create -n py3.7 python=3.7.0


7791cc67863a6eef6baaa54b54c07e6f_d97deb3935204611860b46771c6197b9.png

  1. 激活python3.7的环境
conda activate py3.7

84a8c7181e651838f604cd0302928792_b0e2da06b0824b2a88abadabd1cc27fe.png

  1. 查看存在的python版本
conda env list

66af5d55f874722e1fb1b90a739d1e04_acdf647fbacb4ae29d2efec11b743446.png

相关文章
|
15天前
|
Python
Python的Virtualenv与Venv环境管理器
介绍Python的两种环境管理工具Virtualenv和venv,包括它们的安装、创建、激活、退出环境以及查看帮助信息的方法,同时对比了两者的特点和使用场景。
30 2
Python的Virtualenv与Venv环境管理器
|
15天前
|
Python
Python软件包及环境管理器conda实战篇
详细介绍了如何使用conda进行Python软件包管理及环境管理,包括查看、安装、卸载软件包,切换源,管理不同版本的Python环境,以及解决使用过程中可能遇到的错误。
47 2
Python软件包及环境管理器conda实战篇
|
3天前
|
Python Windows
安装Python环境
安装Python环境
17 8
|
22天前
|
Ubuntu 开发者 Python
|
19天前
|
数据挖掘 定位技术 API
Python GIS神器geopandas 1.0版本来了
Python GIS神器geopandas 1.0版本来了
|
21天前
|
C++ Python
VS Code 搭建 Python 环境 Conda管理
VS Code 搭建 Python 环境 Conda管理
31 2
|
21天前
|
算法 数据可视化 定位技术
QGIS+Conda+jupyter玩转Python GIS
QGIS+Conda+jupyter玩转Python GIS
|
21天前
|
Shell Python 容器
利用Conda尝鲜Python 3.10
利用Conda尝鲜Python 3.10
|
21天前
|
机器学习/深度学习 运维 数据挖掘
scikit-learn 1.0 版本重要新特性一览
scikit-learn 1.0 版本重要新特性一览
|
3月前
|
Linux 数据库管理 Python
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
CentOS7编译安装Python3.10(含OpenSSL1.1.1安装),创建虚拟环境,运行Django项目(含sqlite版本报错)
494 4