question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`bokeh.sampledata.gapminder` not found

See original GitHub issue

I wanted to run the gapminder example from this repo. I made a git clone of the current master branch changed the gapminder directory and started the bokeh server. It seems like the bokeh.sampledata.gapminder could not be found. See log. I only get a white browser window and error messages in the console. Do you have any idea what i could try?

I tried the current master branch: Commit 7093b5f8b5327dcc5f96c711e156fddba2d8b4e7

My bokeh version

max@sam ~/g/b/e/a/gapminder (master)> bokeh --version
0.13.0
max@sam ~/g/b/e/a/gapminder (master)> python3 --version
Python 3.5.2
max@sam ~/g/b/e/a/gapminder (master)> uname -a
Linux sam 4.15.0-38-generic #41~16.04.1-Ubuntu SMP Wed Oct 10 20:16:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
max@sam ~/g/b/e/a/gapminder (master)> firefox --version
Mozilla Firefox 63.0

Error output was:

max@sam ~/g/b/e/a/gapminder (master)> bokeh serve --show main.py 
/home/max/.local/lib/python3.5/site-packages/bokeh/command/util.py:91: UserWarning: 
It looks like you might be running the main.py of a directory app directly.
If this is the case, to enable the features of directory style apps, you must
call "bokeh serve" on the directory instead. For example:

    bokeh serve my_app_dir/

If this is not the case, renaming main.py will supress this warning.

  warnings.warn(DIRSTYLE_MAIN_WARNING)
2018-11-14 23:18:38,729 Starting Bokeh server version 0.13.0 (running on Tornado 5.1.1)
2018-11-14 23:18:38,731 Bokeh app running at: http://localhost:5006/main
2018-11-14 23:18:38,731 Starting Bokeh server with process id: 17874
2018-11-14 23:18:39,023 Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x7fc3fd72a518>: bokeh sample data directory does not exist, please execute bokeh.sampledata.download()
File "sampledata.py", line 113, in external_data_dir:
raise RuntimeError('bokeh sample data directory does not exist, please execute bokeh.sampledata.download()') Traceback (most recent call last):
  File "/home/max/.local/lib/python3.5/site-packages/bokeh/application/handlers/code_runner.py", line 163, in run
    exec(self._code, module.__dict__)
  File "/home/max/git/bokeh/examples/app/gapminder/main.py", line 14, in <module>
    fertility_df, life_expectancy_df, population_df_size, regions_df, years, regions_list = process_data()
  File "/home/max/git/bokeh/examples/app/gapminder/data.py", line 5, in process_data
    from bokeh.sampledata.gapminder import fertility, life_expectancy, population, regions
  File "/home/max/.local/lib/python3.5/site-packages/bokeh/sampledata/gapminder.py", line 62, in <module>
    fertility       = external_csv('gapminder', 'gapminder_fertility.csv', index_col='Country', encoding='utf-8')
  File "/home/max/.local/lib/python3.5/site-packages/bokeh/util/sampledata.py", line 91, in external_csv
    return pd.read_csv(external_path(name), **kw)
  File "/home/max/.local/lib/python3.5/site-packages/bokeh/util/sampledata.py", line 126, in external_path
    data_dir = external_data_dir()
  File "/home/max/.local/lib/python3.5/site-packages/bokeh/util/sampledata.py", line 113, in external_data_dir
    raise RuntimeError('bokeh sample data directory does not exist, please execute bokeh.sampledata.download()')
RuntimeError: bokeh sample data directory does not exist, please execute bokeh.sampledata.download()
 
2018-11-14 23:18:39,033 200 GET /main (127.0.0.1) 65.75ms
2018-11-14 23:18:39,234 404 GET /favicon.ico (127.0.0.1) 0.49ms
2018-11-14 23:18:39,282 101 GET /main/ws?bokeh-protocol-version=1.0&bokeh-session-id=hdaE7bYUmPdSVsConlw2Lwo9rPcLOeOnps7w8klw3K7M (127.0.0.1) 0.65ms
2018-11-14 23:18:39,282 WebSocket connection opened
2018-11-14 23:18:39,283 ServerConnection created
^C
Interrupted, shutting down


Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mattpapcommented, Nov 14, 2018

Simpler approach is to use bokeh sampledata console command, as described in bokeh’s quickstart.

1reaction
noppelmaxcommented, Nov 14, 2018

Ok. I think i got it.

max@sam ~/g/b/e/app (master)> python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bokeh.sampledata
>>> bokeh.sampledata.download()
Creating /home/max/.bokeh directory
Creating /home/max/.bokeh/data directory
Using data directory: /home/max/.bokeh/data
Downloading: CGM.csv (1589982 bytes)
   1589982 [100.00%]
Downloading: US_Counties.zip (3182088 bytes)
   3182088 [100.00%]
Unpacking: US_Counties.csv
Downloading: us_cities.json (713565 bytes)
    713565 [100.00%]
Downloading: unemployment09.csv (253301 bytes)
    253301 [100.00%]
.
.
.
Read more comments on GitHub >

github_iconTop Results From Across the Web

bokeh.sampledata — Bokeh 2.4.0 Documentation
By default, data is downloaded and stored to a directory $HOME/.bokeh/data . This directory will be created if it does not already exist....
Read more >
[BUG] examples/app/gaminder: year 2013 (the latest year in the data ...
this code snippet shows that 2013 is present in the Gapminder data sets from bokeh.sampledata.gapminder import (fertility, life_expectancy, ...
Read more >
python/1586/bokeh/bokeh/sampledata/gapminder.py
''' Provide a pandas DataFrame instance of four of the datasets from gapminder.org. These are read in from csv filess that have been...
Read more >
Gapminder example does not show all charting elements
import pandas as pd import numpy as np import holoviews as hv import panel as pn from bokeh.sampledata import gapminder from holoviews ...
Read more >
Making Interactive Visualizations with Python Using Bokeh
Gapminder started as a spin-off from Professor Hans Rosling's ... Some of Bokeh examples rely on sample data that is not included in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found