lancedb / lancedb

Developer-friendly, serverless vector database for AI applications. Easily add long-term memory to your LLM apps!
https://lancedb.github.io/lancedb/
Apache License 2.0
4.73k stars 326 forks source link

lancedb/python depends on `attr` package, not `attrs` #509

Closed rec closed 1 year ago

rec commented 1 year ago

Hello, LanceDb maintainers! Thanks for a great package, I use it every day.

The issue

We have found a fascinating issue in your dependencies that is mostly caused by errors beyond your control. :-D. We believe it is also the cause of your https://github.com/lancedb/lancedb/issues/387

Write-up is here: but I'll summarize it for you.

Looking at this line, you would expect that it would be using the PyPi library attr, but if you look at the code, there is no .define property!

This worked for us for months, but now fails on a new installation.

The cause

In fact, the attrs project installs two modules, attrs and attr, and that's what you're actually using, and it has an attr.define decorator.

However, the dependency is on attr, which is a tiny, unrelated project.

If you check your Python environment, you will see that there are both attr.py and an attr/ module installed.

Now, apparently in most installations Python uses the directory, but in that new environment, it prefers the .py file, and so gets the tiny attr.py module and emits and error.

The solution

It's a one character change! I'll send it out immediately after this as a pull request, but I still haven't figured out how to run the tests, your guidance is solicited.

chebbyChefNEQ commented 1 year ago

done by #508