Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'kale' #390

Open
fkoehlin opened this issue Nov 24, 2021 · 4 comments
Open

ModuleNotFoundError: No module named 'kale' #390

fkoehlin opened this issue Nov 24, 2021 · 4 comments

Comments

@fkoehlin
Copy link

Hi all,

I've followed the kubeflow-kale README to install

pip install kubeflow-kale 
pip install jupyterlab">=2.0.0, <3.0.0"
jupyter labextension install kubeflow-kale-labextension

in its own virtual environment for a local k8s cluster set up using kind.

Trying to run the example pipeline created from the titanic_dataset_ml.ipynb fails at the load data step with the following error message:

Traceback (most recent call last):
  File "/tmp/tmp.VQmuVObk5f", line 66, in <module>
    _outputs = loaddata(**_parsed_args)
  File "/tmp/tmp.VQmuVObk5f", line 2, in loaddata
    from kale.common import mlmdutils as _kale_mlmdutils
ModuleNotFoundError: No module named 'kale'

The same happens with my own example script. Any hints or ideas?

@basti-j
Copy link

basti-j commented Nov 25, 2021

Just got into Kale as well, but maybe this helps. Maybe it's worth building your own kale image.
In this case based on the open source kubeflownotebooks tf gpu image (but works for every base image for me from https://hub.docker.com/u/kubeflownotebooks):

FROM kubeflownotebooks/jupyter-tensorflow-full-cuda:v0.39.0

USER $NB_UID

RUN python3 -m pip install --upgrade "enum34==1.1.8" && \
    python3 -m pip install --upgrade "jupyterlab>=2.0.0,<3.0.0"

RUN python3 -m pip install --upgrade kfp && \
    python3 -m pip install --upgrade kubeflow-kale && \
    jupyter labextension install kubeflow-kale-labextension --minimize=False

RUN python3 -m pip install --upgrade "jupyter-client==5.3.4"

RUN jupyter lab --generate-config

ENTRYPOINT ["sh", "-c", \
     "jupyter lab --notebook-dir=/home/jovyan --ip=0.0.0.0 --no-browser \
      --allow-root --port=8888 --LabApp.token='' --LabApp.password='' \
      --LabApp.allow_origin='*' --LabApp.base_url=${NB_PREFIX}"]

This at least works for me for running GPU pipelines.
If you don't want to build the image... did you tried to restart your notebook kernel and/or restarting the notebook server?
I think when installing kale inside a running notebook you have to at least restart the notebook server

@fkoehlin
Copy link
Author

Thanks for your answer and Dockerfile.
I've also tried out the official Dockerfile from kale/docker/jupyterlab/ running again into the same error.
I guess I'm hitting the top issue mentioned in the FAQs, i.e. my local toy cluster is not set up to run with Rok, hence imports are not passed between individual pipeline steps.
I'm just confused about that kale itself isn't found since it is for sure in the pod/virtual env running Jupyter lab...

@basti-j
Copy link

basti-j commented Nov 25, 2021

I'm not using Rok as well. But in the 'Advanced Settings` (of the Kale jupyter plugin UI) I have to remount the used volumes manually (to the same mounting points as the notebook has). In this case every pipeline step has access to these volumes.

@fkoehlin
Copy link
Author

Sorry, I don't quite get it yet... Can you give an example on noob level, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants