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:
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.
This guide will introduce you to the PyCharm integrated development environment, which can be used to develop professional applications using the Python programming language. Python is a great programming language because it is truly cross-platform. It can be used to develop a single application which will run on Windows, Linux and Mac computers without having to recompile any code. Run a Python Script Under Mac, Linux, BSD, Unix, etc On platforms like Mac, BSD or Linux (Unix) you can put a 'shebang' line as first line of the program which indicates the location of the Python interpreter on the hard drive.
Can someone offer a solution at least of what I should be trying to do or what to google around for.
Python Tutorial With Pycharm
You can make a new python file by right clicking on your project > New > Python File. Name the file FizzBuzz.py. If you don’t know what FizzBuzz is, please see this blog post. Instead of using a separate program, like PuTTY, MobaXterm, or a Mac Terminal, just do it from within PyCharm. To start an SSH session just use the menu option Tools > Start SSH Session It will prompt you for what remote server you want to use.
Sorry if I lack some of the technical language/knowledge to explain this problem. Thanks
macOS High Sierra 10.13.1
WeAreSystemsWeAreSystems
4 Answers
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.
I just insert this before I import any matplotlib subpackages.
WeAreSystemsWeAreSystems
How To Run Python Program In Pycharm For Mac
I encountered a similar situation that a graph report library based on matplotlib works fine on Conda, Jupyter, but not in Pycharm. It can generate a multi-page pdf. But when I run a program that calls the report library inside Pycharm on MacOS, and the pdf can not be generated properly.
My python 3.6 installation is from Anaconda. I found two solutions. First solution is to run pythonw from a terminal. This is obviously outside of Pycharm, and is not as convenient as you wish.
The second solution is to add 'backend: TkAgg' to matplotlibrc.This file can exist in several places. If this change is meant to be personal, then this file can live under ~/.matplotlib. You can even add this file in the current working directory, to make it part of the program you run.
This is the least intrusive solution without having to add python code that breaks platform compatibility. Formal documentation can be found in the 'The matplotlibrc file' section of https://matplotlib.org/users/customizing.html
Steve LihnSteve Lihn
You just have to install python. You can do that using Homebrew.