Jupyter

install

conda install jupyter notebook

jupyter代理

服务器没连代理,访问不了外网,下载不了外网的模型,jupyter中也跑不了
1,在启动jupyter之前,在终端设置代理

export http_proxy=http://[ip:port] https_proxy=http://[ip:port]

2,启动jupyter

nohup jupyter notebook --notebook-dir=[dir] --ip=0.0.0.0 --port=8888 --allow-root --no-browser --NotebookApp.password=sha1:xxxx &

就可以在jupyter中正常下载外网的模型了。

notebook添加环境

conda activate test
conda install ipykernel
python -m ipykernel install --user --name test --display-name test
jupyter kernelspec list # 查看当前的所有kernel
jupyter kernelspec remove test # 删除jupyter notebook的kernel

添加扩展

pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user

配置

jupyter notebook --generate-config # 生成配置文件
vim ~/.jupyter/jupyter_notebook_config.py #打开配置文件,配置如下:
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.notebook_dir = '<path>'
c.NotebookApp.allow_root = True
c.NotebookApp.password = 'argon2:$argon2...'
c.NotebookApp.allow_password_change = False

其中,password生成:

jupyter notebook password # 输入密码后,生成token
vim ~/.jupyter/jupyter_notebook_config.json # token在这

直接启动jupyter notebook即可。

无输出问题

查看日志,有关于zmq的报错,重新安装

pip uninstall pyzmq
pip install pyzmq==19.0.2

connecting to kernel问题

由于装了其他库导致tornado版本高

pip uninstall tornado
pip install tornado==4.5.3

重启jupyter。

“正在启动,请稍等”问题

有多种原因造成,我这边之前好好地,有次装了openai,然后出的问题,是因为在装openai时可能手动把typing_extensions删了,python -m ipykernel install --user时会报错,重新装回来:pip install typing_extensions,就行了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值