Open eadsjr opened 9 years ago
I had the same problem, and in my case pygtk was not installed. I installed it using hombrew (on Yosemite 10.10.5):
brew install pygtk
But then I got the error you mentioned about _backend_gdk (https://github.com/vhernandez/jwsProcessor/issues/4).
I reinstalled matplotlib with hombrew (instead of pip) with the following options:
brew install matplotlib --with-cairo --with-ghostscript --with-pygtk --with-pyqt --with-pyside --with-tcl-tk --with-tex
But it did not solve the problem.
If I try to launch jwsprocessor
from the command line, I have the following error message:
adding /usr/local/lib to sys.path
2015-08-21 10:03:36.136 Python[9528:213662] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
'jwsprocessor' package could not be found!
I had a little more informations when I try to import jwsprocessor.main
in python:
>>> import jwsprocessor.main
2015-08-21 10:15:13.753 Python[9552:219168] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/jwsprocessor/main.py", line 17, in <module>
from selection_page import SelectionPage
File "/usr/local/lib/jwsprocessor/selection_page.py", line 9, in <module>
from smoothing_selection import ShowSpectrumPanel
File "/usr/local/lib/jwsprocessor/smoothing_selection.py", line 6, in <module>
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 36, in <module>
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py", line 33, in <module>
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
As in https://github.com/vhernandez/jwsProcessor/issues/4, the gdk
backend seems to be installed properly:
>>> import matplotlib
>>> matplotlib.rcsetup.all_backends
[u'GTK', u'GTKAgg', u'GTKCairo', u'MacOSX', u'Qt4Agg', u'Qt5Agg', u'TkAgg', u'WX', u'WXAgg', u'CocoaAgg', u'GTK3Cairo', u'GTK3Agg', u'WebAgg', u'nbAgg', u'agg', u'cairo', u'emf', u'gdk', u'pdf', u'pgf', u'ps', u'svg', u'template']
After installing gtk+3
with hombrew
, and re-installing matplotlib
adding the option --with-gtk+3
, it is still not working:
>>> import jwsprocessor
>>> import jwsprocessor.main
2015-08-21 10:36:54.907 Python[11851:233091] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/jwsprocessor/main.py", line 17, in <module>
from selection_page import SelectionPage
File "/usr/local/lib/jwsprocessor/selection_page.py", line 9, in <module>
from smoothing_selection import ShowSpectrumPanel
File "/usr/local/lib/jwsprocessor/smoothing_selection.py", line 6, in <module>
from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gtk.py", line 36, in <module>
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
File "/usr/local/lib/python2.7/site-packages/matplotlib/backends/backend_gdk.py", line 33, in <module>
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk
>>> import matplotlib
>>> matplotlib.rcParams['backend']
u'MacOSX'
>>> matplotlib.rcsetup.all_backends
[u'GTK', u'GTKAgg', u'GTKCairo', u'MacOSX', u'Qt4Agg', u'Qt5Agg', u'TkAgg', u'WX', u'WXAgg', u'CocoaAgg', u'GTK3Cairo', u'GTK3Agg', u'WebAgg', u'nbAgg', u'agg', u'cairo', u'emf', u'gdk', u'pdf', u'pgf', u'ps', u'svg', u'template']
Do you know where the problem can come from? Thanks in a advance!
I think the problem might come from matplotlib
itself. I tried to uninstall it, and to reinstall it with different options (using either pip
or hombrew
) but it didn't help. Eventually, I built it from the sources.
The header given by setup.py
is:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.dev1]
python: yes [2.7.10 (default, Aug 19 2015, 08:13:40) [GCC
4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.9.2]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.4]
tornado: yes [using tornado version 4.2.1]
pyparsing: yes [using pyparsing version 2.0.3]
libagg: yes [Requires patches that have not been merged
upstream. Using local copy.]
freetype: yes [version 2.6.0]
png: yes [version 1.6.18]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.7 / using mock 1.3.0]
toolkits_tests: yes [using nose version 1.3.7 / using mock 1.3.0]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: yes [installing, Qt: 4.8.7, PySide: 1.2.2; Qt:
4.8.6, PyQt: 4.8.6]
2015-08-21 16:30:00.925 Python[69174:404803] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
gtk3agg: yes [installing, version 3.6.16]
2015-08-21 16:30:01.222 Python[69181:404868] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
gtk3cairo: yes [installing, version 3.6.16]
2015-08-21 16:30:01.790 Python[69130:404726] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
gtkagg: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
tkagg: yes [installing, version 81008]
wxagg: no [requires wxPython]
gtk: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
agg: yes [installing]
cairo: yes [installing, pycairo version 1.10.0]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: yes [version 1.15]
ghostscript: yes [version 9.16]
latex: yes [version 3.14159265]
pdftops: no
It seems that the gtk
libraries are not detected (even though they were installed with homebrew
). However, the gdk and gtk backends are detected in python:
>>> import matplotlib
>>> matplotlib.rcParams['backend']
u'MacOSX'
>>> matplotlib.__version__
'1.5.dev1'
>>> matplotlib.rcsetup.all_backends
[u'GTK', u'GTKAgg', u'GTKCairo', u'MacOSX', u'Qt4Agg', u'Qt5Agg', u'TkAgg', u'WX', u'WXAgg', u'CocoaAgg', u'GTK3Cairo', u'GTK3Agg', u'WebAgg', u'nbAgg', u'agg', u'cairo', u'emf', u'gdk', u'pdf', u'pgf', u'ps', u'svg', u'template']
Hi, I have the exact same issue on windows 7 and on OSX 10.10 and 10.11beta. On Ubuntu works like a charm, but it would be really nice to get it working on win and mac. Any ideas?
I have the same issue on Arch linux using the 'ready to use' package.
Going through jwsprocessor.py manually I find that
>>> import jwsprocessor.main Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/timon/Downloads/jws/jwsProcessor-0.2.0.ready_to_run/lib/jwsprocessor/main.py", line 17, in <module> from selection_page import SelectionPage File "/home/timon/Downloads/jws/jwsProcessor-0.2.0.ready_to_run/lib/jwsprocessor/selection_page.py", line 8, in <module> from tools import SpectraDB, _ File "/home/timon/Downloads/jws/jwsProcessor-0.2.0.ready_to_run/lib/jwsprocessor/tools.py", line 9, in <module> from numpy.oldnumeric import array, arange, Float ImportError: No module named numpy.oldnumeric
Oldnumeric was removed in Numpy 1.9 whereas Arch uses Numpy 1.14.
Problem was caused by out-of-date code from Google sites. Trying fresh clone from this repo now :)
Running setup.py appear to work without an error message.
However, running the jwsprocessor.py file afterwards throws an error.