1. 遠程服務(wù)器miniconda 環(huán)境中創(chuàng)建jupyter環(huán)境
# 1. 激活環(huán)境
conda activate envname
#2. 在環(huán)境中安裝jupyter
pip install jupyter
# 或者
conda install jupyter
#3. 生成jupyter_notebook_config.py文件
jupyter notebook --generate-config
#4. 設(shè)置密碼
jupyter notebook password
#此處為輸出-----------------------------
Enter password:
Verify password:
[NotebookPasswordApp] Wrote hashed password to /.jupyter/jupyter_notebook_config.json
#---------------------------
#5.查看密碼 路徑根據(jù)上一步的輸出根更改 并復制模糊的字符串,不帶引號
vim /.jupyter/jupyter_notebook_config.json
#6. 修改jupyter_notebook_config.py文件 路徑對應(yīng)更改
vim /.jupyter/jupyter_notebook_config.py
#----------------------------在文件末尾加入以下內(nèi)容。。 password 引號中為上一步中復制的內(nèi)容
c.NotebookApp.ip='*' # 修改ip
c.NotebookApp.allow_remote_access = True # 允許遠程連接
c.NotebookApp.password = u'……' # 與json文件生成的密碼對應(yīng)
c.NotebookApp.open_browser = False # 不自動打開瀏覽器
2. 啟動服務(wù)
并指定端口為9999 可自定義更改
jupyter notebook --no-browser --port=10999
3. 查看關(guān)閉服務(wù)
## 停止服務(wù)
jupyter notebook stop
# 失效的情況下,可以使用
#查看當前jupyter端口
jupyter notebook list
# 通過端口獲得pid
lsof -n -i4TCP:[port-number]
## 查看端口信息;
lsof -i :[port-number]
# 刪除進程
kill -9 [PID]
4安裝kernel
conda activate <envname>
conda install nb_conda_kernels
#可有可無
source activate xxx
# 中文部分換成自己的,其他部分不用改
python -m ipykernel install --user --name <envname> --display-name "<envname>"
## 查看已有的kernel
jupyter kernelspec list
#完成后啟動jupyter服務(wù)
5.鏈接pycharm
1.
文章來源:http://www.zghlxwxcb.cn/news/detail-619295.html
2.
文章來源地址http://www.zghlxwxcb.cn/news/detail-619295.html
到了這里,關(guān)于pycharm 使用遠程服務(wù)器 jupyter (本地jupyter同理)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!