question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Supporting conda install in kedro install command

See original GitHub issue

Description

Frequently in data science projects we need to use conda install to handle packages that require configuration / building steps after installation.

Context

I am currently doing a data science project in Kedro which uses deep learning. In this situation using conda install is important as it allows me to handle CUDA/cuDNN dependencies within the ecosystem.

This enhancement fits naturally as most Kedro installations use conda to create virtual environments anyway.

Possible Implementation

If someone creates a file called requirements_conda.txt in the src folder the following code should work to install via pip and conda.

@cli.command()
def install():
    """Install project dependencies from requirements.txt."""
    python_call("pip", ["install", "-U", "-r", "src/requirements.txt"])
    os.system('conda install --file src/requirements_conda.txt --yes')

I’d be happy to contribute the code myself, but I was wondering if this is something that you all envisioned supporting?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
ashwineepandeycommented, Apr 22, 2020

Hi, Not sure this issue has been resolved. I have seen the change that has been made. But I still get the following error when I run kedro install with an environment.yml file:

Screenshot 2020-04-22 at 16 40 54

And this is in alignment with https://github.com/conda/conda/issues/6827#issuecomment-365614464

I believe instead of running conda install… it needs to change to conda env create --file envname.yml.

2reactions
ravindra-siwachcommented, Sep 24, 2020

Following up on this issue (I am aware that the changes are already incorporated in master): I used the kedro install version that uses conda env update --file src/environment.yml --prune After this step, I got the message about activating the newly created environment. After this, however, kedro goes through the process of further processing the dependencies mentioned in requirements.txt. Is this the intended behaviour? As far as I understand those packages will anyway not be installed in the env created through the environment.yml file. For my purposes, I already included all the packages from requirements.txt in environment.yml beforehand. Deleting or renaming the requirements.txt file only leads to kedro complaining that the file can’t be found.

I am just wondering whether it would be better that kedro install stops after the new env is created from environment.yml and not process requirements.txt too? and perhaps also activate the newly created environment in the same step.

I am happy to make the relevant changes and raise a PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install Kedro — Kedro 0.18.4 documentation
To install Kedro from the Python Package Index (PyPI):. pip install kedro. Copy to clipboard. Note. It is also possible to install Kedro...
Read more >
Install Kedro — Kedro 0.17.4 documentation
To install Kedro from the Python Package Index (PyPI) simply run: pip ... Both pip and conda install the core Kedro module, which...
Read more >
Installation prerequisites — Kedro 0.17.7 documentation
Install conda on your computer. ... The conda virtual environment is not dependent on your current working directory and can be activated from...
Read more >
Install Kedro — Kedro 0.17.7 documentation
To install Kedro from the Python Package Index (PyPI) simply run: pip ... Both pip and conda install the core Kedro module, which...
Read more >
Installation guide — kedro-mlflow 0.11.5 documentation
I strongly recommend to use conda (a package manager) to create an environment in order to avoid version conflicts between packages. I also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found