在Jupyter notebook中使用特定虚拟环境中的python的kernel
一开始还以为是tf的问题安装失败,后来才意识到是jupyter的问题。因为在虚拟环境tf中,虽然有jupyter(或者自己再安装pip install jupyter,他会提示说已存在),但这个jupyter还是原python环境中的jupyter。在虚拟环境tf中用命令 (tf) treamy ~ $ which jupyter 得/usr/local/bin/jupyter 再用 (tf) treamy ~ $ find ~/code/pydir/env -name "jupyter*" 发现虚拟环境中无jupyter。故虚拟环境中的jupyter还是原python环境中的jupyter,kernel为python3,而我的原python3并没有安装tensorflow,所以报错了。
之前查网上按这个方法解决:(但无效)
(tf) treamy ~ $ ipython kernelspec install-self --user
(tf) treamy ~ $ mkdir -p ~/.ipython/kernels
(tf) treamy ~ $ mv /Users/treamy/Library/Jupyter/kernels/python3 ~/.ipython/kernels/tfkernel
(tf) treamy ~ $ vim ~/.ipython/kernels/tfkernel/kernel.json
解决方案:
(tf) treamy ~ $ python3 -m ipykernel install --user --name tf --display-name "Python3(tf)"
详细官方文档:
在Jupyter notebook中使用特定虚拟环境中的python的kernel的更多相关文章
- Jupyter Notebook在多个虚拟环境配置与使用
1 问题描述 使用Anaconda配置了包括Pytorch.Tensorflow等多个虚拟环境后,依然无法使用Jupyter Notebook选择不同的虚拟环境运行代码,问题如下图所示. 2 解决方法 ...
- jupyter notebook出现cannot import name 'create_prompt_application'问题(Died Kernel)
应该是在安装其它python第三方库时更新了prompt-toolkit版本,降级到下面的版本即可: sudo pip install 'prompt-toolkit==1.0.15'
- 向jupyter notebook加入Anaconda3中已添加的虚拟环境kernel
# jupyter notebook添加Anaconda虚拟环境的kernel # 开启虚拟环境 (base) C:\Users\jiangshan>activate tensorflow # ...
- linux中jupyter notebook中切换虚拟环境
python -m ipykernel install --user --name 虚拟环境名称 --display-name "虚拟环境名称" 然后再打开jupyter note ...
- anaconda使用以及创建python3.7+pytorch1.0虚拟环境以及Jupyter notebook初级使用
查看所有已安装的软件包$ conda list# packages in environment at S:\Users\jiangshan\Anaconda3:## Name Version Bui ...
- jupyter notebook添加Anaconda虚拟环境的python kernel
之前在自己博客上写了一个如何通过自建配置文件,让jupyter notebook可以调用conda虚拟环境的python解释器. 今天介绍一种更加简单的方式,无需手动配置文件,利用ipykernel可 ...
- 【python】如何将ipdb的python解释器路径切换至虚拟环境中
背景: 利用virtualenv构建一个python3.5的虚拟环境,在该虚拟环境中使用ipdb调试程序,结果报错找不到某一个模块. 程序的所有依赖模块都已经成功安装在虚拟环境中. 在虚拟环境中,te ...
- Jupyter Notebook 介绍 安装和使用技巧
Jupyter Notebook介绍.安装及使用教程 原文链接:https://www.jianshu.com/p/91365f343585 目录一.什么是Jupyter Notebook? 1. 简 ...
- 基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境
基于Ubuntu+Python+Tensorflow+Jupyter notebook搭建深度学习环境 前言一.环境准备环境介绍软件下载VMware下安装UbuntuUbuntu下Anaconda的安 ...
随机推荐
- air游戏接入小米支付sdk
小米支付sdk要求在Application.onCreate中进行初始化 为了这个初始化搞了半天,最终搞定了.今天将更改的步骤记录下了. 1. 创建ANE.ANE的创建就不罗嗦了,这里须要注意一点,这 ...
- python爬虫 (一) 爬虫基础了解,urllib
• URL的含义: 统一资源定位符,结构: URL的格式由三部分组成: ①第一部分是协议(或称为服务方式). ②第二部分是存有该资源的主机IP地址(有时也包括端口号). ③第三部分是主机资源的具体地址 ...
- Installshield 宏定义控制版本
定义宏 在Build =>Setting => 以空格为准定义宏 使用宏 在方法里 #if 宏名称 代码 #else 代码 #endif
- 一步一步学EF系列二【Fluent API的方式来处理实体与数据表之间的映射关系】
EF里面的默认配置有两个方法,一个是用Data Annotations(在命名空间System.ComponentModel.DataAnnotations;),直接作用于类的属性上面,还有一个就是F ...
- git 常用命令行操作
git常用命令行操作: 点击 git bash 进入到命令行: git clone https://github.com/wlz1244/qingoo.git //下载一个master分支代码 g ...
- Python3 计算城市距离
利用上一篇得到的城市经纬度算城市距离 import requests from math import radians, cos, sin, asin, sqrt def geocode(addres ...
- ACM-ICPC 2018 南京赛区网络预赛 - J. Sum (找规律+打表)
题意:\(f(i):i\)能拆分成两个数的乘积,且要求这两个数中各自都没有出现超过1次的质因子.每次给出n,求\(\sum_{i=1}^{n}f(i)\) 分析:\(1 \le n \le 2e7\) ...
- POJ - 3648 Wedding (2-SAT 输出解决方案)
题意:有N-1对夫妇和1对新郎新娘要出席婚礼,这N对人要坐在走廊两侧.要求每对夫妇要坐在不同侧.有M对人有通奸关系,对于这一对人,不能同时坐在新娘对面(新娘新郎也可能和别人有通奸关系).求如何避免冲突 ...
- maven install jdk版本自动降为1.7
开发过程中遇到了一个奇怪的现象. IDEA中所有的设置都改成了1.8,但是在执行maven install时却自动降为1.7,报错提示: [ERROR] Failed to execute goal ...
- FFmpeg 入门(1):截取视频帧
本文转自:FFmpeg 入门(1):截取视频帧 | www.samirchen.com 背景 在 Mac OS 上如果要运行教程中的相关代码需要先安装 FFmpeg,建议使用 brew 来安装: // ...