2021-01-26

本文介绍了解决Jupyter中加载TensorFlow遇到的问题的方法,包括生成notebook配置文件、设置密码、修改配置文件等内容,并提供了卸载和重新安装Jupyter的详细步骤。

在jupyter中无法加载tensorflow的解决方案/

1.创建key的步骤如下:

step1 : 生成一个 notebook 配置文件: jupyter notebook --generate-config
step2 :生成密码:jupyter notebook password
jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json

step3 :修改配置文件 jupyter_notebook_config.py
c.NotebookApp.ip=’*’
c.NotebookApp.password = u’sha:ce…刚才复制的那个密文’
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口
2.在虚拟换环境tensorflow中安装jupyter
python3 -m pip install --upgrade pip
python3 -m pip install jupyter
3.在tensorflow敲jupyter notebook,打开jupyter,默认火狐浏览器,端口8888

出现问题: 在虚拟换环境tensorflow中已经安装了jupyter,仍然不能加载。可能jupyter和tensorflow环境不匹配,需要重新安装jupyter。
卸载jupyter的方法:
1.知乎方法:
Mark 一下Ubuntu 16.04下卸载 jupyter notebook(并非Anaconda安装),希望能帮到大家
打开终端:输入一下命令
sudo python3.6 -m pip uninstall jupyter

sudo python3.6 -m pip uninstall jupyter_core

sudo python3.6 -m pip uninstall jupyter-client

sudo python3.6 -m pip uninstall jupyter-console

sudo python3.6 -m pip uninstall notebook

sudo python3.6 -m pip uninstall qtconsole

sudo python3.6 -m pip uninstall nbconvert
此方法不通
2.卸载
使用pip uninstall jupyter是卸不掉jupyter的

1.(virenv)~/ pip install pip-autoremove
2.(virenv)~/ pip-autoremove jupyter -y

pip-autoremove会卸载掉package和无用的依赖
此法为尝试过。
3敲命令行
conda remove jupyter*
此方法可行
重新安装jupyter

1.在tensorflow虚拟环境中运行 jupyter notebook
有信息
[W 22:37:01.172 NotebookApp] WARNING: The notebook server is listening on all IP addresses and not using encryption. This is not recommended.
[I 22:37:01.194 NotebookApp] Serving notebooks from local directory: /home/max
[I 22:37:01.195 NotebookApp] The Jupyter Notebook is running at:
[I 22:37:01.195 NotebookApp] http://(max-virtual-machine or 127.0.0.1):8888/
[I 22:37:01.195 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
此时,在火狐浏览器输入
http://localhost:8888即可进入

在windows浏览器上登陆方法:
找到虚拟机ip,此处192.168.171.133,端口设为8888

http://192.168.171.133:8888/
即可

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值