konstantint / matplotlib-venn

Area-weighted venn-diagrams for Python/matplotlib
MIT License
520 stars 68 forks source link

Package is broken #78

Closed nzjrs closed 4 months ago

nzjrs commented 7 months ago
Traceback (most recent call last):
  at cell 1, line 2
  at /var/datalore/manager/.pip/matplotlib_venn/__init__.py, line 56
  at /var/datalore/manager/.pip/matplotlib_venn/_venn2.py, line 32
ModuleNotFoundError: No module named 'matplotlib_venn.layout'

layout subpackage is empty because https://github.com/konstantint/matplotlib-venn/blob/master/setup.py#L50 does not find an __init__.py here https://github.com/konstantint/matplotlib-venn/tree/master/matplotlib_venn/layout

konstantint commented 7 months ago

On one hand, this sounds plausible. On the other hand:

I'm fine with adding an extra __init__.py if it does help, but it would be nice to better understand the root problem here. Could you clarify how exactly you arrive at the error message?

nzjrs commented 7 months ago

On one hand, this sounds plausible. On the other hand:

  • I believe __init__.py play no role since Python 3 anymore. Are you trying to install this on a Python 2 system?
  • I can't reproduce the problem. Things I tried so far:

    • (In an empty venv from within checked out repository) pip install .
    • (In an empty venv from within checked out repository) pip install -e .
    • (In an empty venv) pip install matplotlib-venn.

I'm fine with adding an extra __init__.py if it does help, but it would be nice to better understand the root problem here. Could you clarify how exactly you arrive at the error message?

I installed the package from within jetbrains datalore https://datalore.jetbrains.com/notebooks (Python 3.8). I'd love to help you further debug this, but adding the __init__.py is better best practice, and it fixed the problem here.

nzjrs commented 7 months ago

(could be setuptools version tbh, it didnt print the subpackge in find_packages() unless I added the init.py)

konstantint commented 4 months ago

Sorry it took some time to get back to it. I wanted to understand precisely what is the problem and one thing that was for sure not correct was that I used find_packages while find_namespace_packages is the right way to go to make sure setuptools accounts for directories that do not have __init__.py in them.

This, however, still was not enough to make python setup.py install work correctly (pip installation works as intended) so I ended up adding those __init__.py files anyway.

In general it feels that setup.py install is broken for more than matplotlib_venn nowadays - e.g. it also fails to install many of the key dependencies, such as scipy and matplotlib - those only work when installed with pip.

Anyway, this particular issue should be hopefully resolved now.

nzjrs commented 4 months ago

Thanks. In my 20 years of working with Python I have learned that it is a fools errand to try to understand Python packaging, letalone the new flavour of the year tools. It is always broken and will always be so.