Discussion:
[Matplotlib-users] ImportError: No module named _winreg
Martin MOKREJŠ
2015-04-27 20:56:33 UTC
Permalink
Hi,
I use dev-python/matplotlib-1.4.3 and I suspect this is a recent regression in it. Can anybody reproduce this?

$ pychecker test.py
Processing module test (test.py)...
warning: couldn't find real module for class <class 'fftpack.error'> (module name: fftpack)
warning: couldn't find real module for class <class 'lapack_lite.LapackError'> (module name: lapack_lite)
warning: couldn't find real module for class <type 'mtrand.RandomState'> (module name: mtrand)
warning: couldn't find real module for class <type 'mtrand.RandomState'> (module name: mtrand)
ImportError: No module named _winreg
warning: couldn't find real module for class <type 'cntr.Cntr'> (module name: cntr)

Warnings...

test.py:3: Imported module (pylab) not used
$ cat test.py
#! /usr/bin/python

import pylab
$






It was installed with these flags on Gentoo Linux:

# emerge -pv matplotlib

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] dev-python/matplotlib-1.4.3::gentoo USE="cairo examples fltk gtk tk wxwidgets -doc -excel -gtk3 -latex -pyside -qt4 -qt5 {-test}" PYTHON_TARGETS="python2_7 -python3_3 -python3_4" 0 KiB



I use dev-python/pychecker-0.8.19-r1 for the code sanity checks.
http://pychecker.sourceforge.net/ http://pypi.python.org/pypi/PyChecker


Thank you for clues,
Martin
Thomas Caswell
2015-04-27 22:02:19 UTC
Permalink
Those look like they are coming up out of numpy. I am not familiar with
gentoo, but it looks like numpy is not in the dependencies list.

Tom
Post by Martin MOKREJÅ 
Hi,
I use dev-python/matplotlib-1.4.3 and I suspect this is a recent
regression in it. Can anybody reproduce this?
$ pychecker test.py
Processing module test (test.py)...
warning: couldn't find real module for class <class 'fftpack.error'> (module name: fftpack)
warning: couldn't find real module for class <class
'lapack_lite.LapackError'> (module name: lapack_lite)
warning: couldn't find real module for class <type 'mtrand.RandomState'>
(module name: mtrand)
warning: couldn't find real module for class <type 'mtrand.RandomState'>
(module name: mtrand)
ImportError: No module named _winreg
warning: couldn't find real module for class <type 'cntr.Cntr'> (module name: cntr)
Warnings...
test.py:3: Imported module (pylab) not used
$ cat test.py
#! /usr/bin/python
import pylab
$
# emerge -pv matplotlib
Calculating dependencies... done!
[ebuild R ] dev-python/matplotlib-1.4.3::gentoo USE="cairo examples
fltk gtk tk wxwidgets -doc -excel -gtk3 -latex -pyside -qt4 -qt5 {-test}"
PYTHON_TARGETS="python2_7 -python3_3 -python3_4" 0 KiB
I use dev-python/pychecker-0.8.19-r1 for the code sanity checks.
http://pychecker.sourceforge.net/ http://pypi.python.org/pypi/PyChecker
Thank you for clues,
Martin
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Martin MOKREJŠ
2015-05-06 12:19:23 UTC
Permalink
winreg looks like it is for programmatic access to the windows registry which mpl uses to find fonts in windows (https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/font_manager.py#L173).
I suspect this is a problem with pychecker being too enthusiastic about checking imports.
FYI:

+*six-1.9.0-r1 (06 May 2015)
+
+ 06 May 2015; Justin Lecher <***@gentoo.org> +files/six-1.9.0-winreg.patch,
+ +six-1.9.0-r1.ebuild, metadata.xml, six-9999.ebuild:
+ Backport fix for windows only modules, bug #547928
+

https://bugs.gentoo.org/show_bug.cgi?id=547928
Tom
Hi Thomas,
$ python
Python 2.7.9 (default, Apr 10 2015, 16:21:10)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Post by Martin MOKREJÅ 
import pylab
import numpy
import pylab
import numpy
import matplotlib
But, what I really asked for was where does the _winreg come from? It happens only with any of "import pylab" or "import matplotlib".
Martin
Those look like they are coming up out of numpy. I am not familiar with gentoo, but it looks like numpy is not in the dependencies list.
Tom
Hi,
I use dev-python/matplotlib-1.4.3 and I suspect this is a recent regression in it. Can anybody reproduce this?
$ pychecker test.py
Processing module test (test.py)...
warning: couldn't find real module for class <class 'fftpack.error'> (module name: fftpack)
warning: couldn't find real module for class <class 'lapack_lite.LapackError'> (module name: lapack_lite)
warning: couldn't find real module for class <type 'mtrand.RandomState'> (module name: mtrand)
warning: couldn't find real module for class <type 'mtrand.RandomState'> (module name: mtrand)
ImportError: No module named _winreg
warning: couldn't find real module for class <type 'cntr.Cntr'> (module name: cntr)
Warnings...
test.py:3: Imported module (pylab) not used
$ cat test.py
#! /usr/bin/python
import pylab
$
Loading...