Search code examples
pythoncloudanacondabokeh

Set up and run a Bokeh server with Anaconda Cloud


It was announced on the Datacamp Bokeh course that Anaconda Cloud can serve bokeh code without any complicated installment issues. However, my knowledge regarding Anaconda is unsufficient to achieve this.

My problem is as follows:

Starting point: - I have a piece of Python code for an interactive Bokeh plot

Desired Endpoint: - I want to host the code on Anaconda Cloud so that external users can access the plot through their browser without having to install python.

My main question is, Is there currently an easy 'for dummies' tutorial on how to go from the starting point to the endpoint?

My current understanding of anaconda to fully understand which steps I have to take and which parts of the Anaconda/Bokeh documentation I need to achieve my goal.

Example code was taken from:

http://docs.bokeh.org/en/latest/docs/user_guide/server.html


Solution

  • Oh this is nice, anaconda cloud can display your jupyter notebooks, and if you put some interactive bokeh code in them, that part will work great. The notebook will not be interactive, meaning python or whatever other language your notebook is written on will not run, but its cool that html with embedded JS code does. Here is a working example from a code I just uploaded to anaconda cloud: https://anaconda.org/pmreyes2/my_bokeh_interactive_code/notebook

    The steps that I follow to do that are similar to what @Steven C. Howell writes in his answer:

    1. First register on https://anaconda.org
    2. Install the anaconda-client command line client.
    3. Login from your terminal:
      • $ anaconda login
      • use your username and password created in step 1.
    4. Now you can test the connection:
      • $ anaconda whoami
      • This connects to the cloud and your information should be displayed here
    5. Once you have created a jupyter notebook with some interactive bokeh code is time to upload it to your anaconda cloud space:
      • $ anaconda notebook upload my-notebook.ipynb

    Note: This is only for viewing it. An html version of it is created just for viewing it, not for running it. But the cool thing is that if it contains bokeh code, it will run as the example I provide: https://anaconda.org/pmreyes2/my_bokeh_interactive_code/notebook

    UPDATE

    I would also like to mention that the same feature of sharing jupyter notebooks where the bokeh interactive code is alive, can be done using jupyter nbviewer to your GitHub repository. Here the same example shared in anaconda cloud, also in jupyter nbviewer from my GitHub repository: https://nbviewer.jupyter.org/github/pmreyes2/my_jupyter_notebooks/blob/master/My_Bokeh_Interactive_code.ipynb