amosjyng / langchain-visualizer

Visualization and debugging tool for LangChain workflows
MIT License
723 stars 52 forks source link

libyaml-dev requirement is not documented / automated #63

Open b-adkins opened 1 year ago

b-adkins commented 1 year ago

Bug

Installing langchain-visualizer with Pip was not enough for the library to install successfully on my system.

When attempting to import, it would fail on the following command, invoked by the ice library

from yaml import CLoader

No CLoader existed in that environment.

Environment

My project uses a Jupyter server running inside a Docker container, based on an Ubuntu 22 Jammy image. I've been installing the python libs with a requirements.txt passed to pip inside the Dockerfile.

Manual Solution

Here is what worked for me.

  1. Invoke apt in the Dockerfile to install libyaml-dev
    RUN apt update && apt install -y libyaml-dev
  2. Add the following two lines to requirements.txt (passed to pip with -r):
    --global-option='--with-libyaml'
    langchain-visualizer

    At a minimum, this should be documented in the README.md.

Informative Error Message

The import statement could catch the import error and more helpfully inform the user that libyaml-dev is required.

Automatic Solution

Is there a way to require C/C++ libs in Python's package managers? I have no idea.

amosjyng commented 1 year ago

Thanks for letting me know! I've created https://github.com/oughtinc/ice/pull/307 to remove this dependency upstream, and merged #64 to document this in the meantime