dlt icon indicating copy to clipboard operation
dlt copied to clipboard

install `streamlit` dependency on `dlt pipeline show`

Open rudolfix opened this issue 1 year ago • 5 comments

Background Make it easy for the user to use dlt .. show command by optionally adding required dependencies

Tasks

    • [ ] make another extra so you can install streamlit with python-dlt[streamlit]
    • [ ] when running a dlt command, handle MissingImportException and optionally (ask) install the dependencies. Then rerun the command.
    • [ ] do not offer installation if dlt is run outside of virtual env. display a warning instead

rudolfix avatar Feb 27 '23 14:02 rudolfix

Screenshot 2023-02-27 at 17 23 58

I'm stuck in a loop right now, where it keeps telling me to pip install pandas, even after I have done that

TyDunn avatar Feb 27 '23 16:02 TyDunn

@TyDunn is it hard for you to switch to python 3.10 and see if this still happens? I can get back to this task end of this week

rudolfix avatar Feb 28 '23 17:02 rudolfix

Have the same problem with 3.10.10: Screenshot 2023-03-01 at 11 17 12

TyDunn avatar Mar 01 '23 10:03 TyDunn

Also tried 3.9 and had the same problem too

TyDunn avatar Mar 01 '23 10:03 TyDunn

where the problem is coming from:

  1. dlt was pip installed into the main/global python environment
  2. then a virtual environment was created and activated
  3. now the dlt command is run but still from the global environment. it does not see pandas/streamlit so it complains
  4. the user uses pip install but in the activated virtual environment so pandas is installed into it
  5. the dlt ran again in global environment still does not see it so it complains and we are in a loop

How to solve it:

  1. uninstall dlt from global environment, activate virtual environment and install dlt into it

How to fix library:

  1. warn the user when dlt runs from global environment

rudolfix avatar May 05 '23 08:05 rudolfix