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

ImportError: Matplotlib backend_wx and backend_wxagg require wxPython >=2.8.12 #8

Closed
loretoparisi opened this issue Nov 15, 2018 · 6 comments
Labels
bug Something isn't working cantfix Issue is caused by some external component and can not be fixed here

Comments

@loretoparisi
Copy link

This is another potential issue when in macOS that can be handled changing matplotlib settings in ~/.matplotlib/matplotlibrc: with

backend : MacOSX
@f90
Copy link
Owner

f90 commented Nov 15, 2018

Can you confirm this permanently fixed your issue with matplotlib in your case? If so, I will add that into the Known issues / Troubleshooting section of the Readme for people who might encounter the same problem, since unfortunately it cannot be fixed on my end. Except if I ported the whole Project to Python >=2.8, but this seems overblown for this easily fixable problem on a specific platform.

@loretoparisi
Copy link
Author

@f90 Yes I confirm, this is a well known issue with matplotlib when on macOS.

@f90
Copy link
Owner

f90 commented Nov 15, 2018

OK thanks, I will link to this issue in the README. Closing this then.

@f90 f90 closed this as completed Nov 15, 2018
@loretoparisi
Copy link
Author

loretoparisi commented Nov 15, 2018

@f90 I can be more precise. When on macOS you have two options. If python is installed as a framework you can choose backend: MacOSX. If not, you have to choose backend: TkAgg.
This means that if you are in virtualenv, at the end you MUST use this last one option. Outside virtualenv it's ok the first (!)

See here for more info https://markhneedham.com/blog/2018/05/04/python-runtime-error-osx-matplotlib-not-installed-as-framework-mac/

And here https://stackoverflow.com/a/21353372/758836

That's weird, isn'it? 👍

@f90
Copy link
Owner

f90 commented Nov 15, 2018

Thanks.. Thats' awkward, so I will link to this info from the README for future people to avoid confusion

f90 added a commit that referenced this issue Nov 15, 2018
Added notice into Readme about libsndfile being required on system (issue #7)
Librosa requirement from 0.6.1 to 0.6.2
Added notice about how to use the project without GPU (by enabling CPU-Version) into Readme
Added notice about MacOS matplotlib issue (issue #8) into Readme
@loretoparisi
Copy link
Author

@f90 by the way there is another trick!!! You can even define your local matplotlibrc. I have just realized this (I was not aware this from the docs actually), because if you run Jupyter, and this is normally outside virtualenv, you need MacOSX backend 👯‍♂️

ip-192-168-22-127:Notebooks loretoparisi$ python --version
Python 2.7.15
ip-192-168-22-127:Notebooks loretoparisi$ cat ~/.matplotlib/matplotlibrc:
cat: /Users/loretoparisi/.matplotlib/matplotlibrc:: No such file or directory
ip-192-168-22-127:Notebooks loretoparisi$ cat ~/.matplotlib/matplotlibrc
backend : TkAgg
ip-192-168-22-127:Notebooks loretoparisi$ ls
README.md       data            hello.py        pandas.py       pima.py         simple.py
ip-192-168-22-127:Notebooks loretoparisi$ touch matplotlibrc
ip-192-168-22-127:Notebooks loretoparisi$ echo "backend : MacOSX" >> matplotlibrc
ip-192-168-22-127:Notebooks loretoparisi$

So I run in VSCode Juypyter but I had to overwrite locally this file 🗡 just commited this change!

schermata 2018-11-16 alle 10 36 03

@f90 f90 added bug Something isn't working cantfix Issue is caused by some external component and can not be fixed here labels Nov 16, 2018
f90 added a commit that referenced this issue Dec 2, 2018
…prediction runnable without matplitlib to avoid MacOS problems (see issues #15 #12 #8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cantfix Issue is caused by some external component and can not be fixed here
Projects
None yet
Development

No branches or pull requests

2 participants