大醉和尚  
qq:3262641915,如有问题,欢迎讨论.
  • 查看token
    jupyter notebook list

  • ascii 报错
    LANG=zn jupyter notebook --ip spark004 --port 8123

pip 安装复杂的lib

pip install --ignore-installed imageio

  • 禁用下载

密码

$ python

> from notebook.auth import passwd
> passwd()

如下是设置禁止下载文件的一个功能(根据需要配置)


c.NotebookApp.ip = '172.23.10.254’    ##设置访问notebook的ip,*表示所有ip
 
c.NotebookApp.port = 8886    ##指定访问的端口,默认是8888;
 
c.NotebookApp.password = 'sha1:3c5ff94afafb:4daf378e7404a52e7b1a2823095b912aaa84e55c’    ##填写刚刚第2步生成的密钥

import os, sys
 
sys.path.append('/home/winco_jkjr/.jupyter/')
 
import files_handlers
 
c.ContentsManager.files_handler_class = 'files_handlers.ForbidDownloadingFilesHandler'
 
c.ContentsManager.files_handler_params = {}
from tornado import web
 
from notebook.base.handlers import IPythonHandler
 
 
class ForbidDownloadingFilesHandler(IPythonHandler):
 
    @web.authenticated
 
    def head(self, path):
 
        self.log.info("对不起,禁止下载文件!!!")
 
        raise web.HTTPError(403)
 
    @web.authenticated
 
    def get(self, path, include_body=True):
 
        self.log.info("对不起,禁止下载文件!!!")
 
        raise web.HTTPError(403)

nohup jupyter notebook > /home/winco_jkjr/software/jupyter.log 2>&1 &

  • 定时重启

#!/bin/sh

. /etc/profile
. ~/.bash_profile

#/usr/sbin/fuser -k 8889/tcp 
/usr/local/anaconda2/bin/jupyter notebook stop 8889
/usr/local/anaconda2/bin/jupyter notebook >> .logs/jupyter.log 2>&1 &
  • windows 配置 pip.ini

  1. 文件夹地址栏 输入 %APPDATA%
    2.创建pip文件夹,新建pip.ini
[global]
timeout = 6000
index-url=http://mirrors.cloud.aliyuncs.com/pypi/simple/
[install]
trusted-host=mirrors.cloud.aliyuncs.com
posted on 2021-03-31 20:18  大醉和尚  阅读(185)  评论(0编辑  收藏  举报