Giter Club home page Giter Club logo

Comments (16)

Carreau avatar Carreau commented on July 20, 2024 7

Yep, remember that there is no error if there is a typo.

--ServerPostProcessor.ip='*'   # wrong
--ServePostProcessor.ip='*'  #right

you wrote an extra r :-)

from nbconvert.

williamstein avatar williamstein commented on July 20, 2024 3

OK let's close it again...

Perhaps we could add some docs here about how to change the port:
http://nbconvert.readthedocs.io/en/latest/usage.html#convert-revealjs

from nbconvert.

Carreau avatar Carreau commented on July 20, 2024

If you want to serve on another port I would suggest just converting to slides and then firering a real http server (python -m http.server <port>) IIRC listen on all interfaces.

The post --server is really just for convenience, and building extra config option is a slippery slope that will becomme too complex./

from nbconvert.

mertzjames avatar mertzjames commented on July 20, 2024

Problem with that is that it doesn't render the slides correctly. It renders like a flat HTML file.

from nbconvert.

Carreau avatar Carreau commented on July 20, 2024

Problem with that is that it doesn't render the slides correctly. It renders like a flat HTML file.

Hum indeed. apparently it does not work anymore, the code use a tornado proxy to map reveal.js location.

Fortunately the flags are already there (we all learn things everyday) !

$ jupyter nbconvert --to slides  --ServePostProcessor.port=8910 --ServerPostProcessor.ip='*' --post serve <mynotebook.ipynb>
# [Edit, extra r read ServerPostProcessor above]

Maybe --help-all should list the flags of all pre/post-processors ? @damianavila

from nbconvert.

mertzjames avatar mertzjames commented on July 20, 2024

I ran this:

jupyter nbconvert "notebook.ipynb" --to slides --post serve --ServerPostProcessor.ip="0.0.0.0"

and got this error:

Traceback (most recent call last):
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\Scripts\jupyter-nbconvert-script.py", line 5, in <module>
    main()
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\jupyter_core\application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\traitlets\config\application.py", line 592, in launch_instance
    app.start()
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 286, in start
    self.convert_notebooks()
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 409, in convert_notebooks
    self.convert_single_notebook(notebook_filename)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 382, in convert_single_notebook
    self.postprocess_single_notebook(write_results)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\nbconvertapp.py", line 367, in postprocess_single_notebook
    self.postprocessor(write_results)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\postprocessors\base.py", line 28, in __call__
    self.postprocess(input)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\nbconvert\postprocessors\serve.py", line 87, in postprocess
    http_server.listen(self.port, address=self.ip)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tornado\tcpserver.py", line 126, in listen
    sockets = bind_sockets(port, address=address)
File "C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3\lib\site-packages\tornado\netutil.py", line 187, in bind_sockets
    sock.bind(sockaddr)
OSError: [WinError 10048] Only one usage of each socket address (protocol/network address/port) is normally permitted

Using and ip address of '*' still only serves the pages on the local host ip address.

from nbconvert.

Carreau avatar Carreau commented on July 20, 2024

Hum. works for me but I'm on master. We might have had a recent bugfix to fix that. What if you use another port ?

from nbconvert.

damianavila avatar damianavila commented on July 20, 2024

Working for me with latest released nbconvert..

from nbconvert.

mertzjames avatar mertzjames commented on July 20, 2024

I'm using Anaconda. Here's is the output of conda info jupyter:

jupyter 1.0.0 py34_0
--------------------
file name   : jupyter-1.0.0-py34_0.tar.bz2
name        : jupyter
version     : 1.0.0
build number: 0
build string: py34_0
channel     : defaults
size        : 2 KB
date        : 2015-08-13
license     : BSD
md5         : 5db5a3d83d2440686158466e6bbd4ce5
installed environments:
    C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3
dependencies:
    ipykernel 4.0.3
    ipywidgets 4.0.2
    jupyter_console
    nbconvert
    notebook
    python 3.4*
    qtconsole

I was able to finally resolve my issue by editing the serve.py file in nbconvert to have the ip address of 0.0.0.0. It's a temporary fix.

Here is what I was able to get from running conda info nbconvert:

nbconvert 4.0.0 py34_0
----------------------
file name   : nbconvert-4.0.0-py34_0.tar.bz2
name        : nbconvert
version     : 4.0.0
build number: 0
build string: py34_0
channel     : defaults
size        : 307 KB
date        : 2015-08-13
license     : BSD
md5         : 54a272cad6289ec1e03b2dd04c9497ec
installed environments:
    C:\Users\KronoSKoderS\AppData\Local\Continuum\Anaconda3
dependencies:
    ipython
    jinja2
    jupyter_core
    mistune
    nbformat
    pygments
    python 3.4*
    traitlets

from nbconvert.

mertzjames avatar mertzjames commented on July 20, 2024

I should also note, that running:

ipython nbconvert "notebook.ipynb" --to slides --post serve --ServerPostProcessor.ip="0.0.0.0"

works, but doesn't do anything with changing the ip address.

from nbconvert.

damianavila avatar damianavila commented on July 20, 2024

I think this is related with this: #103 (comment)

Maybe something win-specific??

from nbconvert.

damianavila avatar damianavila commented on July 20, 2024

@KronoSKoderS can you test if jupyter/jupyter_core#54 fix this issue as well?

from nbconvert.

mertzjames avatar mertzjames commented on July 20, 2024

I spoke a little too soon and tested in an unclean environment. I had made a custom change to serve.py in nbconvert/postprocessors like so:

class ServePostProcessor(PostProcessorBase):
    """Post processor designed to serve files

    Proxies reveal.js requests to a CDN if no local reveal.js is present
    """


    open_in_browser = Bool(True, config=True,
        help="""Should the browser be opened automatically?"""
    )
    reveal_cdn = Unicode("https://cdn.jsdelivr.net/reveal.js/2.6.2", config=True,
        help="""URL for reveal.js CDN."""
    )
    reveal_prefix = Unicode("reveal.js", config=True, help="URL prefix for reveal.js")
    ip = Unicode("0.0.0.0", config=True, help="The IP address to listen on.")  #CHANGED SOMETHING HERE!!!!
    port = Int(8000, config=True, help="port for the server to listen on.")

Running the following command:

jupyter nbconvert --to slides  --ServePostProcessor.port=8910 --ServerPostProcessor.ip='*' --post serve <mynotebook.ipynb>

get's us half way there. The IP address does not change, however the port does.

from nbconvert.

damianavila avatar damianavila commented on July 20, 2024

@Carreau @minrk ideas? maybe some trailets related issue? mmm...

from nbconvert.

Carreau avatar Carreau commented on July 20, 2024

Well technically I did by bad copy pasting.

from nbconvert.

damianavila avatar damianavila commented on July 20, 2024

Well technically I did by bad copy pasting.

My bad too... OK let's close it again...

from nbconvert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.