[KED-1454] reload_kedro magic script not working with jupyter
See original GitHub issueDescription
I created a new kedro environment and ran kedro jupyter notebook to create a notebook. Then I execute the %reload_kedro command which gave the following error: 2020-02-22 09:45:31,139 - root - ERROR - Kedro appears not to be installed in your current environment or your current IPython session was not started in a valid Kedro project.
I also executed the kedro ipython command to get the following error: Traceback (most recent call last): File “/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/application/current.py”, line 6, in <module> from contextvars import ContextVar ModuleNotFoundError: No module named ‘contextvars’
Context
How has this bug affected you? What were you trying to accomplish? i am unable to use jupyter notebook with kedro context
Steps to Reproduce
- create a new project
- create a notebook with kedro jupyter notebook
- make some catalog entries
- try to run the %reload_kedro magic command
Expected Result
it should load the catalog entries
Actual Result
error
-- If you received an error, place it here.
2020-02-22 09:45:31,139 - root - ERROR - Kedro appears not to be installed in your current environment or your current IPython session was not started in a valid Kedro project.
ImportError Traceback (most recent call last) <ipython-input-10-abfcd54c960b> in <module> ----> 1 get_ipython().run_line_magic(‘reload_kedro’, ‘’)
/anaconda3/envs/python3/lib/python3.7/site-packages/IPython/core/interactiveshell.py in run_line_magic(self, magic_name, line, _stack_depth) 2312 kwargs[‘local_ns’] = sys._getframe(stack_depth).f_locals 2313 with self.builtin_trap: -> 2314 result = fn(*args, **kwargs) 2315 return result 2316
~/Desktop/personal/code/DataScience/kaggle_future_sales/future_sales/.ipython/profile_default/startup/00-kedro-init.py in reload_kedro(path, line) 20 try: 21 import kedro.config.default_logger —> 22 from kedro.context import KEDRO_ENV_VAR, load_context 23 from kedro.cli.jupyter import collect_line_magic 24 except ImportError:
ImportError: cannot import name ‘KEDRO_ENV_VAR’ from ‘kedro.context’ (/anaconda3/envs/python3/lib/python3.7/site-packages/kedro/context/init.py)
-------------------------------------------------------------------------------
Starting a Kedro session with the following variables in scope
startup_error, context
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/future_sales/lib/python3.6/site-packages/prompt_toolkit/application/current.py", line 6, in <module>
from contextvars import ContextVar
ModuleNotFoundError: No module named 'contextvars'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/envs/future_sales/bin/ipython", line 5, in <module>
from IPython import start_ipython
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/IPython/__init__.py", line 56, in <module>
from .terminal.embed import embed
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/IPython/terminal/embed.py", line 16, in <module>
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/IPython/terminal/interactiveshell.py", line 19, in <module>
from prompt_toolkit.enums import DEFAULT_BUFFER, EditingMode
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/__init__.py", line 16, in <module>
from .application import Application
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/application/__init__.py", line 1, in <module>
from .application import Application
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/application/application.py", line 38, in <module>
from prompt_toolkit.buffer import Buffer
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/buffer.py", line 28, in <module>
from .application.current import get_app
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/application/current.py", line 8, in <module>
from prompt_toolkit.eventloop.dummy_contextvars import ContextVar # type: ignore
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/eventloop/__init__.py", line 1, in <module>
from .async_generator import generator_to_async_generator
File "/anaconda3/envs/future_sales/lib/python3.6/site-packages/prompt_toolkit/eventloop/async_generator.py", line 5, in <module>
from typing import AsyncGenerator, Callable, Iterable, TypeVar, Union
ImportError: cannot import name 'AsyncGenerator'
Your Environment
Include as many relevant details about the environment in which you experienced the bug: kedro, version 0.15.5
- Kedro version used (
pip show kedro
orkedro -V
): - Python version used (
python -V
): Python 3.6.0 :: Continuum Analytics, Inc. - Operating system and version: macOS 10.14.6
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (7 by maintainers)
Top GitHub Comments
@Francisco-Reveriano This worked for me:
@oscartse68 We’re so glad that you’re all sorted out on this one. I have one question and recommendation for you as a follow-up to this question you’ve asked.
My question is, “Why would you like to see a YouTube or video-based learning channel for Kedro?”
And then on that I would definitely recommend checking out the DataEngineerOne series on YouTube. It’s a series of Kedro tutorials on different functionality done by a super user of Kedro.