Changing the default port for iPython notebook server / Jupyter

后端 未结 5 806
盖世英雄少女心
盖世英雄少女心 2021-02-02 07:26

I am trying to run an ipython notebook / jupyter server on a machine behind a firewall. The only port which is open is port 80. So was wondering how I can change the default por

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-02 07:56

    ipython notebook --ip=0.0.0.0 --port=80 or
    jupyter notebook --ip=0.0.0.0 --port=80
    

    is what i did to run ipython in my vagrant box. (Opened up the ports on the vagrant box to access it on my host mac)

    usage: ipython [-h] [--certfile NOTEBOOKAPP.CERTFILE] [--ip NOTEBOOKAPP.IP]
                   [--pylab [NOTEBOOKAPP.PYLAB]]
                   [--log-level NOTEBOOKAPP.LOG_LEVEL]
                   [--port-retries NOTEBOOKAPP.PORT_RETRIES]
                   [--notebook-dir NOTEBOOKAPP.NOTEBOOK_DIR]
                   [--config NOTEBOOKAPP.CONFIG_FILE]
                   [--keyfile NOTEBOOKAPP.KEYFILE] [--port NOTEBOOKAPP.PORT]
                   [--transport KERNELMANAGER.TRANSPORT]
                   [--browser NOTEBOOKAPP.BROWSER] [--script] [-y] [--no-browser]
                   [--debug] [--no-mathjax] [--no-script] [--generate-config]
    

    Incase the port is already occupied, see what's blocking it - inmy case it was an old instance of ipython which had not been terminated properly. I kiiled them all with this command

    ps auxww | grep 'ipython' | awk '{print $2}' | xargs sudo kill -9
    

提交回复
热议问题