Closed ichernev closed 1 year ago
🤖
Hello,
The error message you're seeing is due to the presence of multiple top-level packages in the repository. This is not allowed by setuptools when using a flat layout, which is the case when you're running pip install -e .
.
The error message suggests three possible solutions:
find
directive with include
or exclude
)src-layout
py_modules
or packages
with a list of namesGiven the structure of the LangChain repository, the third option seems to be the most appropriate. You can specify the packages to be installed in the setup.py
file or pyproject.toml
file, depending on which one you're using.
If you're using a setup.py
file, you can specify the packages like this:
from setuptools import setup, find_packages
setup(
name="LangChain",
version="0.0.296",
packages=find_packages(),
)
If you're using a pyproject.toml
file, you can specify the packages like this:
[tool.poetry]
name = "LangChain"
version = "0.0.296"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.dependencies]
python = "^3.8"
In both cases, the find_packages()
function will automatically discover all packages and subpackages. If you want to exclude certain packages, you can pass them as arguments to the exclude
parameter.
Please try this solution and let me know if it works for you. If you encounter any other issues, feel free to ask.
Best regards, Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
So you need to: cd libs/langchain
and do pip install -e .
from there...
So you need to:
cd libs/langchain
and dopip install -e .
from there...
For anyone looking for a solution for requirements.txt
here, you can use:
langchain @ git+https://github.com/langchain-ai/langchain@master#subdirectory=libs/langchain
The #subdirectory=
feature tells it where to find the actually library.
System Info
Linux, Python 3.11.5
Who can help?
No response
Information
Related Components
Reproduction
python -m venv .venv
. .venv/bin/activate
pip install -e .
Expected behavior
To install package in a local virtualenv.
What happens: