Closed ghbrown closed 5 months ago
I know nothing changed on your side, but this seems resolved now. The sample code runs successfully after installing via the first (standard) approach.
Not sure if I had some sort of bug in my setup before, or if it has to do with now being on setuptools 70.0.0.
While trying to fork and edit pyttb, I faced errors manifesting as pyttb importing modules/classes/functions in a manner inconsistent with
__init__.py
.Ultimately, I believe this is due to issues with pip and/or setuptools as they add support for PEP660 for editable installs of projects using
pyproject.toml
.Consider the following code, which uses pyttb in accordance with the init file:
This code errors with
X = ttb.tensor(X) AttributeError: module 'pyttb' has no attribute 'tensor'
if installing pyttb via:In particular, it seems that this happens because the
pyttb/build/__editable__.pyytb<some more stuff>
is not being included in PYTHONPATH, which may be an issue to report upstream to pip or setuptools.(Workaround) The code runs successfully if installing via:
Eventually, I believe a future version of pip and/or setuptools will make this issue irrelevant, but in the meantime here is the workaround. It also seems plausible
pyproject.toml
could be edited to made more robust to these transitional issues.System info:
pip 24.0 (python 3.9)
setuptools 69.5.1
Relevant links: