MAC里jupyter notebook 提示importerror但是终端中import正常
2018-01-25 11:38
1206 查看
环境:virtualenv,发现如题所示问题,首先暴力尝试重装jupyter notebook,有部分环境可以解决题目问题,部分环境下jupyter还是提示importerror,尝试修改jupyter notebook的kernel环境。
首先分别在终端中的python环境下和jupyter notebook中查看所使用的python版本:
发现jupyter notebook调用的python路径与终端下python并不相同,修改jupyter notebook的kernel环境,在终端中的python环境下输入:
可以看到jupyter指定kernel的文件路径,mac按住command键点击路径,可直接跳转到该文件夹,打开kernel.json文件,将其中"argv"中的python地址更换为终端中的python地址即可。
重启终端,打开jupyter notebook,import正常。
首先分别在终端中的python环境下和jupyter notebook中查看所使用的python版本:
import sys
sys.executable
发现jupyter notebook调用的python路径与终端下python并不相同,修改jupyter notebook的kernel环境,在终端中的python环境下输入:
ipython kernelspec list
可以看到jupyter指定kernel的文件路径,mac按住command键点击路径,可直接跳转到该文件夹,打开kernel.json文件,将其中"argv"中的python地址更换为终端中的python地址即可。
重启终端,打开jupyter notebook,import正常。
相关文章推荐
- jupyter notebook import error但是命令提示符import正常
- Mac安装jupyter notebook
- jupyter notebook无法正常启动
- 在ubuntu终端退出jupyter notebook
- 解决Jupyter notebook[import tensorflow as tf]报错
- 解决在jupyter notebook中遇到的ImportError: matplotlib is required for plotting问题
- mac 下用chrome浏览器打开jupyter notebook 出现dead kernel问题
- 27个Jupyter Notebook小提示与技巧
- Mac下Jupyter(即IPython-notebook)的搭建及使用(更建议安装Anaconda环境直接自带jupyter notebook)
- Mac 安装jupyter notebook的过程
- Mac 安装Jupyter notebook
- 27 个Jupyter Notebook的小提示与技巧
- 在Mac上使用Jupyter Notebook遇到打不开浏览器的情况
- Mac下安装python以及jupyter notebook
- jupyter notebook import error: no module named 'matplotlib'
- Mac远程访问Ubuntu Jupyter notebook
- mac 下在服务器上运行 Jupyter notebook
- Mac 远程运行 服务器 jupyter notebook
- mac 安装jupyter notebook
- 27 个Jupyter Notebook的小提示与技巧