https://kedro.org/ logo
#beginners-need-help
Title
# beginners-need-help
c

ChainYo

01/06/2022, 10:17 AM
Hey, I just discovered Kedro last night and give it a try this morning with the spacefights tutorial . I'm a bit confused about using kedro in conda env. It seems that
kedro install
or
pip install -r src/requirements.txt
install correctly things in the env, but
kedro ipython
doesn't use it... I was getting errors with loading things in
catalog
and
%reload_kedro
. The errors are gone if I use the main ubuntu env without conda.
d

datajoely

01/06/2022, 10:18 AM
when you type
which kedro
what comes up?
c

ChainYo

01/06/2022, 10:18 AM
inside the conda env ?
d

datajoely

01/06/2022, 10:18 AM
yes
c

ChainYo

01/06/2022, 10:19 AM
/home/chainyo/.local/bin/kedro
but
which python
gives me
/home/chainyo/miniconda3/envs/kedro-tuto/bin/python
I uninstalled kedro in my global env and reinstalled it in my conda env. The output is different...
/home/chainyo/miniconda3/envs/kedro-tuto/bin/kedro
it seems to be broken somewhere, but I don't know if it comes from my own conda/python install or not ? 😄
d

datajoely

01/06/2022, 10:29 AM
Hello!
this is annoying and feels like a bit of conda weirdness we all know and lvoe
c

ChainYo

01/06/2022, 10:29 AM
yes conda is trash...
d

datajoely

01/06/2022, 10:29 AM
now I think this is right
home/chainyo/miniconda3/envs/kedro-tuto/bin/kedro
c

ChainYo

01/06/2022, 10:30 AM
not really because kedro ipython keep using my global env and can't find dependencies if it's uninstalled
d

datajoely

01/06/2022, 10:31 AM
stupid quiestion
c

ChainYo

01/06/2022, 10:31 AM
anyways this is a good day to start using docker as env manager for project
d

datajoely

01/06/2022, 10:31 AM
have you open and closed your terminal since uninstalling
c

ChainYo

01/06/2022, 10:31 AM
yes I just did it
enjoy 😄
Copy code
(kedro-tuto) @chainyo {kedro-tutorial} > kedro ipython
2022-01-06 11:31:47,335 - kedro.framework.cli.hooks.manager - INFO - Registered CLI hooks from 1 installed plugin(s): kedro-telemetry-0.1.3
Kedro-Telemetry is installed, but you have opted out of sharing usage analytics so none will be collected.
-------------------------------------------------------------------------------
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
Python 3.8.10 (default, Nov 26 2021, 20:14:08) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.31.0 -- An enhanced Interactive Python. Type '?' for help.
[TerminalIPythonApp] WARNING | Error in loading extension: kedro.extras.extensions.ipython
Check your config files in /home/chainyo/code/kedro-tutorial/.ipython/profile_default
Traceback (most recent call last):
  File "/home/chainyo/.local/lib/python3.8/site-packages/IPython/core/shellapp.py", line 301, in init_extensions
    self.shell.extension_manager.load_extension(ext)
  File "/home/chainyo/.local/lib/python3.8/site-packages/IPython/core/extensions.py", line 80, in load_extension
    mod = import_module(module_str)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'kedro'
d

datajoely

01/06/2022, 10:33 AM
okay different approach
with your env active
can you go into a normal ipython session
c

ChainYo

01/06/2022, 10:34 AM
ye
d

datajoely

01/06/2022, 10:34 AM
then run this
Copy code
python
%load_ext kedro.extras.extensions.ipython
%reload_kedro <path_to_project_root>
c

ChainYo

01/06/2022, 10:35 AM
first command failed
ModuleNotFoundError: No module named 'kedro'
and second too because :
UsageError: Line magic function '%reload_kedro' not found.
d

datajoely

01/06/2022, 10:36 AM
okay
if you do
outside of ipython
pip freeze | grep kedro
is it there?
c

ChainYo

01/06/2022, 10:37 AM
Copy code
bash
kedro==0.17.6
kedro-telemetry==0.1.3
d

datajoely

01/06/2022, 10:37 AM
oh man I have no idea what's going on
c

ChainYo

01/06/2022, 10:37 AM
me neither
I should stop using conda
that's all
d

datajoely

01/06/2022, 10:37 AM
I can only recommend new venv and then start from scratch
c

ChainYo

01/06/2022, 10:37 AM
yes
d

datajoely

01/06/2022, 10:37 AM
I use it normally without trouble
c

ChainYo

01/06/2022, 10:37 AM
I will maybe use docker container env
I saw there is a
kedro-docker
right ?
d

datajoely

01/06/2022, 10:38 AM
yeah but it's more for dockerising a 'done' project
c

ChainYo

01/06/2022, 10:38 AM
ok
d

datajoely

01/06/2022, 10:39 AM
so the only advantage of docker here is that you start from a fresh install and don't have other things interfering with their references
in theory a new conda env should have the same effect
c

ChainYo

01/06/2022, 10:40 AM
yes
well anyways, I will go with my global env for now and retry later and choose an env manager 😄
thanks for help & time
d

datajoely

01/06/2022, 10:40 AM
Good luck!