美文网首页
conda&jupyter&虚拟环境

conda&jupyter&虚拟环境

作者: 沿哲 | 来源:发表于2021-02-05 22:30 被阅读0次

环境版本

win10
anaconda:4.9.2(自带jupyter)
python:3.8

换源

  1. conda换源
    使用 conda config --add……命令,参照anaconda conda 换源
  2. C盘/用户/你的用户名/.condarc
    记事本编辑这个文件,内容换成如下
channels:
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
show_channel_urls: true
  1. pip换源
    C:\Users\你的用户名路径下新建pip文件夹,文件夹内新建pip.ini文件,内容如下:
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn

安装虚拟环境

  1. 创建python版本为3.8的虚拟环境,名称为py3.8
conda create -n py3.8 python=3.8
  1. 进入虚拟环境
activate py3.8
  1. 虚拟环境中安装jupyter,注意我这里用的是conda命令!
conda install jupyter

PS: 有很多教程要安装ipykernel,而且是通过pip命令。我试过但是感觉后续有很多很多问题~(头秃)

  1. 启动jupyter,点击 kernel-change kernel,能看到py3.8环境。然后就可以启在jupyter下用虚拟环境了!

更换D盘目录

一般一打开jupyter,目录都是C盘的
如果想切换到D盘,在终端先后分别输入

D:
jupyter notebook

我是先激活了虚拟环境再启动的jupyter,也可以在base环境中切换到D盘再启动jupyter



如果先激活虚拟环境,再启动的jupyter,new里面没有了虚拟环境列表,下图的python3就是这个虚拟环境!!!



在base环境中切换到D盘再启动jupyter,能看到所有的环境~

相关文章

  • conda&jupyter&虚拟环境

    环境版本 win10anaconda:4.9.2(自带jupyter)python:3.8 换源 conda换源使...

  • Python学习笔记8

    虚拟环境 背景 解决方案 虚拟环境准备 使用虚拟环境 用pycharm操作虚拟环境 虚拟环境的管理 集中式虚拟环境...

  • virtualenvwrapper 软件包管理

    安装依赖 使用 创建虚拟环境 创建指定解释器的虚拟环境 启动虚拟环境 退出虚拟环境 删除虚拟环境 进入虚拟环境目录

  • 虚拟环境virtualenv

    安装 创建 查看虚拟环境 进入虚拟环境 退出虚拟环境 删除虚拟环境 说明

  • centos7进入和退出虚拟环境方法

    一、创建虚拟环境文件夹 二、启动虚拟环境,进入虚拟环境目录,启动虚拟环境,如下: 三、退出虚拟环境

  • django虚拟环境搭建

    ubuntu中虚拟环境搭建 安装虚拟环境 配置虚拟环境 virtualenvwrapper功能 创建虚拟环境 安装...

  • virtualenv创建python虚拟环境

    安装: 创建虚拟环境: 启动虚拟环境: 退出虚拟环境:

  • virtualenvwrapper

    安装命令 新建虚拟环境 退出虚拟环境 查看当前有哪些虚拟环境 进入某个虚拟环境 在虚拟环境中安装开发包

  • tensorflow虚拟环境搭建

    环境安装 退出虚拟环境 删除虚拟环境 查看虚拟环境

  • virtualenvwrapper使用

    安装virtualenvwrapper 基本使用 创建虚拟环境 切换到某个虚拟环境 退出当前虚拟环境 删除虚拟环境...

网友评论

      本文标题:conda&jupyter&虚拟环境

      本文链接:https://www.haomeiwen.com/subject/qshgtltx.html