Kedro: Jupyter Notebook and iPython launch issues

Created on 26 Jun 2019  路  3Comments  路  Source: quantumblacklabs/kedro

Description

When running kedro ipython or kedro jupyter notebook from my project root, I get FileNotFound errors.

It seems both ipython and Jupyter must be pip installed manually, despite them appearing to be fundamental to using Kedro.

This may be misunderstanding on my part, since I assumed they would be available given that libraries like Pandas were available for writing the data_engineering.py ETL functionality, but a note in the Installation docs reminding users to manually install them would prevent other users from making similar mistakes.

Context

I'm walking through the Spaceflight tutorial, and want to be able to follow the "develop in notebooks then copy/paste to src" philosophy.

Steps to Reproduce

  1. cd kedro-tutorial
  2. conda activate kedro_env
  3. kedro ipython or kedro jupyter notebook

Expected Result

A new ipython session should start, or the Jupyter notebook server should be available for access through my browser.

Actual Result

I receive a FileNotFoundError, indicating that there is No such directory 'ipython' : 'ipython'. It seems that the newly-created conda environment for this project is without either ipython or jupyter.

Jupyter Notebook

-------------------------------------------------------------------------------
Starting a Kedro session with the following variables in scope
proj_dir, proj_name, io, startup_error
Use the line magic %reload_kedro to refresh them
or to see the error message if they are undefined
-------------------------------------------------------------------------------
jupyter-notebook --ip=127.0.0.1
Traceback (most recent call last):
  File "/anaconda3/envs/kedro_env/bin/kedro", line 10, in <module>
    sys.exit(main())
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/kedro/cli/cli.py", line 557, in main
    ("Project specific commands", project_groups),
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/josephhaaga/Documents/TylorData/kedro_test/spaceflights_demo/kedro-tutorial/kedro_cli.py", line 207, in jupyter_notebook
    call(["jupyter-notebook", "--ip=" + ip] + list(args))
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/kedro/cli/utils.py", line 48, in call
    res = subprocess.run(cmd, **kwargs).returncode
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'jupyter-notebook': 'jupyter-notebook'

ipython

-------------------------------------------------------------------------------
Starting a Kedro session with the following variables in scope
proj_dir, proj_name, io, startup_error
Use the line magic %reload_kedro to refresh them
or to see the error message if they are undefined
-------------------------------------------------------------------------------
ipython
Traceback (most recent call last):
  File "/anaconda3/envs/kedro_env/bin/kedro", line 10, in <module>
    sys.exit(main())
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/kedro/cli/cli.py", line 557, in main
    ("Project specific commands", project_groups),
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/josephhaaga/Documents/TylorData/kedro_test/spaceflights_demo/kedro-tutorial/kedro_cli.py", line 134, in ipython
    call(["ipython"] + list(args))
  File "/anaconda3/envs/kedro_env/lib/python3.6/site-packages/kedro/cli/utils.py", line 48, in call
    res = subprocess.run(cmd, **kwargs).returncode
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 423, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/anaconda3/envs/kedro_env/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ipython': 'ipython'

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • Kedro version used (pip show kedro or kedro -V): kedro, version 0.14.2
  • Python version used (python -V): Python 3.6.8 :: Anaconda, Inc.
  • Operating system and version: OS X Mojave 10.14.5

Checklist

Include labels so that we can categorise your issue:

  • [ ] Add a "Component" label to the issue
  • [ ] Add a "Priority" label to the issue
Bug Report Documentation

All 3 comments

Hi @josephhaaga! We're so glad you're working your way through our tutorial and thank you for flagging this. I think this issue may be related to documentation. In our docs, we forgot to mention running kedro install which should have installed all of Kedro's dependencies.

Please do try the command and let us know if it resolves this issue. I'll update the documentation.

Ahh that worked, thanks!

Awesome! I'm going to close this ticket. We just merged in a documentation fix. Thank you for making our docs better!

Was this page helpful?
0 / 5 - 0 ratings