guilgautier / DPPy

Python toolbox for sampling Determinantal Point Processes
https://dppy.readthedocs.io
MIT License
219 stars 53 forks source link

Issue on Travis with matplotlib backend on OSX #6

Closed guilgautier closed 6 years ago

guilgautier commented 6 years ago

https://travis-ci.org/guilgautier/DPPy/jobs/400324355

from dppy.discrete_dpps import *
../../../.pyenv/versions/3.4.6/lib/python3.4/site-packages/dppy/discrete_dpps.py:9: in <module>
    import matplotlib.pyplot as plt
../../../.pyenv/versions/3.4.6/lib/python3.4/site-packages/matplotlib/pyplot.py:115: in <module>
    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
../../../.pyenv/versions/3.4.6/lib/python3.4/site-packages/matplotlib/backends/__init__.py:62: in pylab_setup
    [backend_name], 0)
../../../.pyenv/versions/3.4.6/lib/python3.4/site-packages/matplotlib/backends/backend_macosx.py:17: in <module>
    from matplotlib.backends import _macosx
E   RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are using (Ana)Conda please install python.app and replace the use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in the Matplotlib FAQ for more information.
guilgautier commented 6 years ago

Potential fix https://matplotlib.org/faq/osx_framework.html or https://stackoverflow.com/a/43015816

Naereen commented 6 years ago

I think a dirty fix can be indeed https://stackoverflow.com/questions/3285193/how-to-switch-backends-in-matplotlib-python/43015816#43015816

See https://matplotlib.org/api/matplotlib_configuration_api.html#matplotlib.use

guilgautier commented 6 years ago

I tried the first option and it seems to have done job. The first option will only fix general issues with matplotlib on OSX for Travis, but not for local installation. What do you think @Naereen ?

Naereen commented 6 years ago

I don't think there is a problem with local installation, but cannot test it (no OSX at hand)

guilgautier commented 6 years ago

Should not be a problem you're right, @rbardenet wrote and ran the test locally on his Mac, closing the issue.