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

Missing __init__.py file in mpl_toolkits #9823

Closed
frenzymadness opened this issue Nov 21, 2017 · 5 comments
Closed

Missing __init__.py file in mpl_toolkits #9823

frenzymadness opened this issue Nov 21, 2017 · 5 comments
Labels
Milestone

Comments

@frenzymadness
Copy link

Bug report

Bug summary

I am building python-matplotlib RPM for Fedora and I've found out that I cannot execute tests because the file mpl_toolkits/__init__.py is missing.

Code for reproduction

MATPLOTLIBDATA=$PWD/lib/matplotlib/mpl-data/ PYTHONPATH=/builddir/build/BUILDROOT/python-matplotlib-2.1.0-1.fc28.2.x86_64/usr/lib64/python2.7/site-packages/ python tests.py 

Actual outcome

('Python byte-compilation optimization level:', 0)
========================================== test session starts ==========================================
platform linux2 -- Python 2.7.14, pytest-3.2.3, py-1.5.2, pluggy-0.4.0
rootdir: /builddir/build/BUILD/matplotlib-2.1.0, inifile: pytest.ini

===================================== no tests ran in 0.00 seconds ======================================
ERROR: file or package not found: mpl_toolkits.tests (missing __init__.py?)
$ cat setup.cfg
[packages]
tests = True
toolkits_tests = True

[rc_options]
backend = TkAgg
$ cd /builddir/build/BUILDROOT/python-matplotlib-2.1.0-1.fc28.2.x86_64/usr/lib64/python2.7/site-packages/mpl_toolkits/
$ ll
total 92
drwxr-xr-x. 2 mockbuild mock  4096 Nov 21 11:44 axes_grid
drwxr-xr-x. 2 mockbuild mock  4096 Nov 21 11:44 axes_grid1
drwxr-xr-x. 2 mockbuild mock  4096 Nov 21 11:44 axisartist
-rw-r--r--. 1 mockbuild mock  3966 Oct  3 08:50 exceltools.py
-rw-r--r--. 2 mockbuild mock  3966 Nov 21 11:44 exceltools.pyc
-rw-r--r--. 2 mockbuild mock  3966 Nov 21 11:44 exceltools.pyo
-rw-r--r--. 1 mockbuild mock 19211 Oct  3 08:50 gtktools.py
-rw-r--r--. 1 mockbuild mock 19805 Nov 21 11:44 gtktools.pyc
-rw-r--r--. 1 mockbuild mock 19766 Nov 21 11:44 gtktools.pyo
drwxr-xr-x. 2 mockbuild mock  4096 Nov 21 11:44 mplot3d
drwxr-xr-x. 3 mockbuild mock  4096 Nov 21 11:44 tests

Expected outcome

Existing __init__.py file in /usr/lib64/python2.7/site-packages/mpl_toolkits/ and running tests.

Matplotlib version

  • Operating system: Fedora 28 (rawhide)
  • Matplotlib version: 2.1.0 built from source
  • Matplotlib backend (print(matplotlib.get_backend())): TkAgg
  • Python version: 2.7.14 from distribution package
@jklymak
Copy link
Member

jklymak commented Nov 21, 2017

Its in master, so there is something wrong w/ your install. Closing, but feel free to reopen if you think this is a Matplotlib problem.

@jklymak jklymak closed this as completed Nov 21, 2017
@chbrown
Copy link

chbrown commented Mar 26, 2018

I hit upon this issue regarding the missing __init__.py when I updated my matplotlib to 2.2.2 via pip install -U matplotlib, with Python 3.6.4 (from Homebrew), which caused csvkit, at least, to spout the following warning (repeated a total of 78 times, in quick succession):

/usr/local/Cellar/python/3.6.4_4/Frameworks/Python.framework/Versions/3.6/lib/python3.6/importlib/_bootstrap_external.py:426: ImportWarning: Not importing directory /usr/local/lib/python3.6/site-packages/mpl_toolkits: missing __init__

Neither the wheel (pip uninstall -y matplotlib && pip install matplotlib) nor source (pip uninstall -y matplotlib && pip install --no-binary matplotlib matplotlib) properly installed that __init__.py file, but I can silence the warnings, and presumably do what pip ought to be doing, by manually installing the missing file:

wget https://pypi.python.org/packages/ec/ed/46b835da53b7ed05bd4c6cae293f13ec26e877d2e490a53a709915a9dcb7/matplotlib-2.2.2.tar.gz
tar -x -O - -f matplotlib-2.2.2.tar.gz matplotlib-2.2.2/lib/mpl_toolkits/__init__.py > /usr/local/lib/python3.6/site-packages/mpl_toolkits/__init__.py

Why pip seems to neglect that file, which is right there in the tarball, I don't know.

@jklymak
Copy link
Member

jklymak commented Mar 26, 2018

Maybe the toolkits aren't being installed by default in the pip build? Re-opening to attract attention from someone who knows more about the builds and pip....

@jklymak jklymak reopened this Mar 26, 2018
@jklymak jklymak added the Build label Mar 26, 2018
@jklymak jklymak added this to the v3.0 milestone Mar 26, 2018
@anntzer
Copy link
Contributor

anntzer commented Mar 27, 2018

If we keep the mpl_toolkits namespace around (really not clear it's worth it, but heh), we should probably just make it an implicit namespace package (per https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages) in 3.0.

@tacaswell tacaswell modified the milestones: v3.0, v3.1 Aug 11, 2018
@tacaswell tacaswell modified the milestones: v3.1.0, v3.2.0 Mar 18, 2019
@timhoffm timhoffm modified the milestones: v3.2.0, v3.3.0 Aug 16, 2019
@timhoffm timhoffm modified the milestones: v3.3.0, v3.4.0 May 24, 2020
@QuLogic QuLogic modified the milestones: v3.4.0, v3.5.0 Jan 27, 2021
@QuLogic QuLogic modified the milestones: v3.5.0, v3.6.0 Aug 18, 2021
@QuLogic QuLogic modified the milestones: v3.6.0, v3.7.0 Jul 8, 2022
@QuLogic QuLogic modified the milestones: v3.7.0, v3.8.0 Jan 26, 2023
@QuLogic QuLogic self-assigned this Jan 26, 2023
@QuLogic
Copy link
Member

QuLogic commented Mar 17, 2023

Closing as duplicate of #25244, as that's where discussion is happening.

@QuLogic QuLogic closed this as completed Mar 17, 2023
@QuLogic QuLogic removed their assignment Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants