Closed jack89roberts closed 4 years ago
@jack89roberts When following the instructions in the app section of the README, I get a "python is not installed as a framework" error. related to matplotlib. Advice?
(wimbledon) MAC-ATI0132:app moreilly$ python app.py
Traceback (most recent call last):
File "app.py", line 3, in <module>
from wimbledon.vis import Visualise
File "/Users/moreilly/Source/Turing/WimbledonPlanner/wimbledon/vis/__init__.py", line 1, in <module>
from .Visualise import *
File "/Users/moreilly/Source/Turing/WimbledonPlanner/wimbledon/vis/Visualise.py", line 10, in <module>
from wimbledon.vis import HTMLWriter
File "/Users/moreilly/Source/Turing/WimbledonPlanner/wimbledon/vis/HTMLWriter.py", line 6, in <module>
from distinctipy import distinctipy
File "/Users/moreilly/.virtualenvs/wimbledon/lib/python3.7/site-packages/distinctipy/distinctipy.py", line 7, in <module>
import matplotlib.pyplot as plt
File "/Users/moreilly/.virtualenvs/wimbledon/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2372, in <module>
switch_backend(rcParams["backend"])
File "/Users/moreilly/.virtualenvs/wimbledon/lib/python3.7/site-packages/matplotlib/pyplot.py", line 207, in switch_backend
backend_mod = importlib.import_module(backend_name)
File "/Users/moreilly/.virtualenvs/wimbledon/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/moreilly/.virtualenvs/wimbledon/lib/python3.7/site-packages/matplotlib/backends/backend_macosx.py", line 14, in <module>
from matplotlib.backends import _macosx
ImportError: 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.
Ah, this is an OS X specific matplotlib issue that comes up sometimes and I haven't found a guaranteed fix/workaround for yet. There's some relevant info here: https://matplotlib.org/faq/osx_framework.html
Few ideas:
1) If you're using virtualenv could you try venv instead as described by the link above?
2) What's the output of this in the shell for the version of python you're using (or does the import just fail)?
>>> import matplotlib
>>> matplotlib.get_backend()
Unless the above gives TKAgg or Agg already, could you try creating ~/.matplotlib/matplotlibrc
and adding the line:
backend: TKAgg
The output of matplotlib.get_backend()
should be TKAgg after doing this. Does the app then start without giving the error? If not you could also try backend: Agg
in matplotlibrc.
3) I've added a commit to this pull request with a changed import order to force the use of a specific matplotlib backend earlier, which may also help.
This removes the "Name" label from the index column to get around the issue with the "sticky" heading not keeping the project names in view after scrolling down.