在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/
即可