langchain-ai / langgraph-studio

Desktop app for prototyping and debugging LangGraph applications locally.
https://studio.langchain.com
1.97k stars 131 forks source link

requirements install fails when gcc is needed for some requirement #60

Closed JCourt1 closed 2 months ago

JCourt1 commented 3 months ago

When installing requirements, I am running into an error where certain wheels fail to build. Basically, the docker build doesn't have access to tools like gcc that are required for building these wheels.

Specifically seeing this for psutil and argon2-cffi but the problem is a general one.

I can't just delete the requirements like psutil that require building wheels, because my langgraph graph lives inside a django app, and has logic that requires accessing models etc. basically fully plugged in to the django app. I think this same problem could bite anyone whose langgraph graph requires the context of a complex app.

Here is the relevant part of the error logs:

#7 33.90       gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=595 -DPy_LIMITED_API=0x03060000 -DPSUTIL_ETHTOOL_MISSING_TYPES=1 -DPSUTIL_LINUX=1 -I/usr/local/include/python3.11 -c psutil/_psutil_common.c -o build/temp.linux-aarch64-cpython-311/psutil/_psutil_common.o
#7 33.90       psutil could not be installed from sources because gcc is not installed. Try running:
#7 33.90         sudo apt-get install gcc python3-dev
#7 33.90       error: command 'gcc' failed: No such file or directory
#7 33.90       [end of output]
#7 33.90   
#7 33.90   note: This error originates from a subprocess, and is likely not a problem with pip.
#7 33.90   ERROR: Failed building wheel for psutil
#7 33.91   Building wheel for roundrobin (setup.py): started
#7 34.49   Building wheel for roundrobin (setup.py): finished with status 'done'
#7 34.49   Created wheel for roundrobin: filename=roundrobin-0.0.4-py3-none-any.whl size=4018 sha256=b658853e2bea0b2b04ac1f363e20dfc45b1714e4bd94b361f696edd596e10869
#7 34.49   Stored in directory: /tmp/pip-ephem-wheel-cache-7cad5oqs/wheels/a0/bc/5d/8714573bb8dd7e86b272448c8837bc0ea19e6b4ab3a46fca2b
#7 34.49 Successfully built coverage django-coverage-plugin flask-basicauth ipdb roundrobin
#7 34.49 Failed to build argon2-cffi psutil
#7 34.49 ERROR: Could not build wheels for argon2-cffi, psutil, which is required to install pyproject.toml-based projects

Possible solution

I think it might be enough to allow passing arguments to the pip install that gets called in the docker build:

RUN PYTHONDONTWRITEBYTECODE=1 pip install --no-cache-dir -c /api/constraints.txt -e /deps/*

If we could pass --no-binary then it would just build from sources and might work?

hwchase17 commented 3 months ago

Can this be fixed by adding dockerfile_lines to the configuration file? https://langchain-ai.github.io/langgraph/cloud/reference/cli/#configuration-file

dqbd commented 2 months ago

Closing issue for now, dockerfile_lines can be used to install missing dependencies