Hey, I just discovered Kedro last night and give i...
# beginners-need-help
c
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
when you type
which kedro
what comes up?
c
inside the conda env ?
d
yes
c
/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
Hello!
this is annoying and feels like a bit of conda weirdness we all know and lvoe
c
yes conda is trash...
d
now I think this is right
home/chainyo/miniconda3/envs/kedro-tuto/bin/kedro
c
not really because kedro ipython keep using my global env and can't find dependencies if it's uninstalled
d
stupid quiestion
c
anyways this is a good day to start using docker as env manager for project
d
have you open and closed your terminal since uninstalling
c
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
okay different approach
with your env active
can you go into a normal ipython session
c
ye
d
then run this
Copy code
python
%load_ext kedro.extras.extensions.ipython
%reload_kedro <path_to_project_root>
c
first command failed
ModuleNotFoundError: No module named 'kedro'
and second too because :
UsageError: Line magic function '%reload_kedro' not found.
d
okay
if you do
outside of ipython
pip freeze | grep kedro
is it there?
c
Copy code
bash
kedro==0.17.6
kedro-telemetry==0.1.3
d
oh man I have no idea what's going on
c
me neither
I should stop using conda
that's all
d
I can only recommend new venv and then start from scratch
c
yes
d
I use it normally without trouble
c
I will maybe use docker container env
I saw there is a
kedro-docker
right ?
d
yeah but it's more for dockerising a 'done' project
c
ok
d
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
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
Good luck!