jupyter(安装及卸载)

目录

1.(创建,激活,退出,删除)虚拟环境

2.安装及卸载

2.1安装

2.2.卸载

3.jupyter notebook添加Anaconda的虚拟环境(就是为了能在jupyter中使用pytorch)

4.运行jupyter时导入库遇到的一些报错

4.1导入pandas

参考文献


1.(创建,激活,退出,删除)虚拟环境

先打开Anaconda Prompt,创建虚拟环境并激活虚拟环境(如果不想在虚拟环境下安装,则忽略此步)

# 创建虚拟环境
conda create -n Pytorch2 python=3.7 # Pytorch2 是虚拟环境的名字,可自由更换,python=3.7指定你需要的版本。

conda env list # 查看环境列表,知道系统中所有设置的环境

# 激活虚拟环境
Linux: source activate Pytorch2 #Pytorch2为你想要激活环境的名字
Windows: activate Pytorch2

python --version # 检查当前虚拟环境python的版本

# 退出当前虚拟环境
Linux: source deactivate Pytorch2 
Windows:deactivate Pytorch2 

# 删除虚拟环境
conda remove -n Pytorch2 --all

2.安装及卸载

2.1安装

激活创建的虚拟环境进行安装

1.pip3安装

pip3 install jupyter

2.pip安装

pip install jupyter

3.cuda安装

conda install jupyter

2.2.卸载

用什么安装用什么卸载

1.pip卸载

pip uninstall jupyter

2.cuda安装

cuda uninstall jupyter

3.jupyter notebook添加Anaconda的虚拟环境(就是为了能在jupyter中使用pytorch)


:此时虚拟环境中的pytorch,pandas等无法在jupyter中使用,需要建立起juyper和anaconda的练联系。

在刚刚创建的虚拟环境下输入

 1. 命令行在窗口中利用pip安装ipykernel
输入:pip install ipykernel

2. 建立Jupyter与anaconda环境的联系
-输入:pip install nb_conda
 

4.运行jupyter时导入库遇到的一些报错

4.1导入pandas

直接输入

pip install pandas

报错

ERROR: Could not find a version that satisfies the requirement pandas (from versions: none)
ERROR: No matching distribution found for pandas

解决1: 

# 信任镜像源后下载
pip install pandas -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

 解决2

# python3以上版本用以下代码,python2版本将下列代码的3改为2
py -3 -m pip install pandas -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com

解决3:如果1,2不行

pip --trusted-host pypi.python.org install pandas

其他镜像源地址

国内常用镜像源
清华大学 :https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学 :http://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学:http://pypi.hustunique.com/
豆瓣源:http://pypi.douban.com/simple/
腾讯源:http://mirrors.cloud.tencent.com/pypi/simple
华为镜像源:https://repo.huaweicloud.com/repository/pypi/simple/

参考文献

1.Jupyter Notebook 安装与使用教程_小智解说的博客-CSDN博客

2.下载 jupyter_jupyter下载_未来之王的博客-CSDN博客

3.Jupyter NoteBook下载、安装、numpy安装、pandas安装、代码补全_草莓泡芙@的博客-CSDN博客

4.最新Anaconda 创建Python3.6,Python3.7虚拟环境,为Pytorch,tensorflow创建单独环境_anaconda创建python3.6_集电极的博客-CSDN博客

5.Jupyter中安装深度学习pytorch框架并import torch测试_赴迢遥的博客-CSDN博客 

6.在Anaconda Jupyter Notebook中如何安装Pytorch_MaliciousSoftware的博客-CSDN博客 

7.【Anaconda+jupyter notebook】jupyter notebook安装的三种方法及切换虚拟环境_conda install jupyter_Kiki酱。的博客-CSDN博客 

  • 2
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值