ubuntu怎么在jupyter notebook中引入anaconda虚拟环境

ubuntu怎么在jupyter notebook中引入anaconda虚拟环境

~坑:
先activate visaul envirument 再打开jupyter notebook 是不行的
conda install nb_conda 也是不行的

正确做法:
conda create -n your_env_name python=X.X #创建环境
//先activate pytorch 再pip install ipykernel
python -m ipykernel install --user --name=your env name

如果你的pip install 速度太慢,请参考这里,给pip换源

1. 安装jupyter notebook: 在终端运行以下命令安装jupyter notebook: ``` sudo apt-get update sudo apt-get install jupyter-notebook ``` 2. 安装文支持: 在终端运行以下命令安装文支持: ``` sudo apt-get install ibus ibus-clutter ibus-gtk ibus-gtk3 ibus-qt4 ``` 然后重启电脑。 3. 安装jupyter notebook文支持: 在终端运行以下命令安装jupyter notebook文支持: ``` sudo pip3 install jupyter sudo pip3 install jupyter_contrib_nbextensions sudo jupyter contrib nbextension install --user sudo jupyter nbextension enable code_prettify/code_prettify sudo jupyter nbextension enable execute_time/ExecuteTime sudo jupyter nbextension enable spellchecker/main sudo jupyter nbextension enable notify/notify sudo jupyter nbextension enable toc2/main sudo jupyter nbextension enable freeze/main sudo jupyter nbextension enable varInspector/main sudo jupyter nbextension enable hide_input_all/hide_input_all ``` 4. 启动jupyter notebook: 在终端运行以下命令启动jupyter notebook: ``` jupyter notebook ``` 或者在应用程序找到jupyter notebook,双击启动。 5. 修改jupyter notebook的配置文件: 在终端运行以下命令打开jupyter notebook的配置文件: ``` jupyter notebook --generate-config ``` 然后使用Vi编辑器编辑配置文件: ``` vi .jupyter/jupyter_notebook_config.py ``` 添加以下代码: ``` c.NotebookApp.locale = 'zh-CN' c.IPKernelApp.pylab = 'inline' # in-line figure when using Matplotlib c.NotebookApp.open_browser = False # 不启动浏览器 ``` 保存文件并退出Vi编辑器。 6. 重新启动jupyter notebook: 在终端运行以下命令重新启动jupyter notebook: ``` jupyter notebook ``` 现在你应该可以在jupyter notebook看到文界面了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值