I can run code through terminal and have a matplotlib window pop up with the graph but not through Pycharm. All I get is an error saying:
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.
I'm not sure how to install Python as a framework or what that really means. I've googled about but I don't want to mess my system up.
Can someone offer a solution at least of what I should be trying to do or what to google around for.
Sorry if I lack some of the technical language/knowledge to explain this problem. Thanks
Professional feature: download PyCharm Professional to try. In this tutorial, you operate in Scientific Mode and use Matplotlib and NumPy packages to run and debug a Python code with data visualization. Before you start, ensure the following is installed: Conda interpreter.
To verify that Matplotlib is installed, try to invoke Matplotlib's version at the Python REPL. Use the commands below that include calling the . __version__ an attribute common to most Python packages.
Interactive plots in the SciView window are not supported by PyCharm at the moment. If you want to use the mouse cursor to see the values at specific graph points, you can render plots in the native matplotlib GUI.
If you install matplotlib with pip, or conda, you should have a directory ~/.matplotlib
.
Inside that directory create, or open if it already exists, a file called matplotlibrc
.
To make TkAgg the default backend just add the line backend: TkAgg
I found a short term fix until I can make changes to the necessary files from user Iron Pillow.
import matplotlib
matplotlib.use('TkAgg')
I just insert this before I import any matplotlib subpackages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With