Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package is broken #78

Closed
nzjrs opened this issue Apr 16, 2024 · 5 comments
Closed

Package is broken #78

nzjrs opened this issue Apr 16, 2024 · 5 comments
Assignees

Comments

@nzjrs
Copy link

nzjrs commented Apr 16, 2024

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 konstantint self-assigned this Apr 22, 2024
@konstantint
Copy link
Owner

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?

@nzjrs
Copy link
Author

nzjrs commented Apr 22, 2024

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
Copy link
Author

nzjrs commented Apr 22, 2024

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

@konstantint
Copy link
Owner

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
Copy link
Author

nzjrs commented Jul 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants