I run my script in virtualenv. Python version is 3.5.
Add a line:
backend: TkAgg
in file:
~/.matplotlib/matplotlibrc
This solved the problem.
If you want to know more about why adding this solves the problem, you can read about customizing matplotlib’s backend. And TkAgg solves this issue because of it’s dependency with Tkinter.
Related Posts:
- How to uninstall Python 2.7 on a Mac OS X 10.6.4?
- pip or pip3 to install packages for Python 3?
- Python can’t find module NLTK
- How can I run python in terminal on a mac?
- RuntimeWarning: invalid value encountered in divide
- Updating Python on Mac
- How do I upgrade to Python 3.6 with conda?
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- How to change default Python version?
- ImportError: No module named sklearn (Python)
- How to change default Python version?
- What version of Python is on my Mac?
- ModuleNotFoundError: No module named ‘matplotlib’
- Change figure size and figure format in matplotlib
- How can I install a previous version of Python 3 in macOS using homebrew?
- boto3 python 2.7 ImportError: No module named boto3 USER_BASE USER_SITE site packages doesn’t exist
- Python: source code string cannot contain null bytes
- How to install pip for Python 3 on Mac OS X?
- Kill a python process
- Homebrew brew doctor warning about /Library/Frameworks/Python.framework, even with brew’s Python installed
- TypeError: ‘int’ object is not subscriptable
- ImportError: DLL load failed: The specified module could not be found
- ImportError: DLL load failed: The specified module could not be found
- bash: pip: command not found
- bash: pip: command not found
- What is the difference between importing matplotlib and matplotlib.pyplot?
- Purpose of “%matplotlib inline”
- How to uninstall pip on OSX?
- What is the result of % in Python?
- Reading an Excel file in python using pandas
- Error: ‘int’ object is not subscriptable – Python
- How to uninstall Anaconda completely from macOS
- Python Variable Declaration
- How do I compare two strings in python?
- Purpose of “%matplotlib inline”
- ImportError: No module named pip
- TypeError: ‘int’ object is not callable
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- ImportError: No module named pip
- Showing an image with pylab.imshow()
- python – how to get the data from an plt.imshow()?
- TypeError: ‘int’ object is not callable
- ImportError: No module named matplotlib.pyplot
- How do I install pip on macOS or OS X?
- working of \n in python [duplicate]
- ImportError: No module named matplotlib.pyplot
- Pip freeze vs. pip list
- What is the necessity of plt.figure() in matplotlib?
- How do I install pip on macOS or OS X?
- TypeError: ‘int’ object is not callable
- How do you change the size of figures drawn with Matplotlib?
- Cannot find module cv2 when using OpenCV
- Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
- Cannot find module cv2 when using OpenCV
- Python ‘If not’ syntax [duplicate]
- Where to place $PATH variable assertions in zsh?
- Converting dictionary to JSON
- Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
- ImportError: No module named pandas. Pandas installed pip
- Is “from matplotlib import pyplot as plt” == “import matplotlib.pyplot as plt”?
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- No “Proceed Anyway” option on NET::ERR_CERT_INVALID in Chrome on MacOS
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ImportError: No module named matplotlib.pyplot
- matplotlib savefig() plots different from show()
- Could not install packages due to a “Environment error :[error 13]: permission denied : ‘usr/local/bin/f2py'”
- WinError 2 The system cannot find the file specified (Python)
- IndexError: tuple index out of range —– Python
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- How do I draw a grid onto a plot in Python?
- Could not install packages due to an EnvironmentError:
- TypeError: cannot perform reduce with flexible type
- Could not find a version that satisfies the requirement tensorflow
- Xcode is not currently available from the Software Update server
- How to view / open a calculator in mac OS X?
- sklearn error ValueError: Input contains NaN, infinity or a value too large for dtype(‘float64’)
- Plotting a 2D heatmap with Matplotlib
- Save plot to image file instead of displaying it using Matplotlib
- Could not find a version that satisfies the requirement tensorflow
- Local variable referenced before assignment?
- Xcode is not currently available from the Software Update server
- ln (Natural Log) in Python
- How to plot ROC curve in Python
- Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
- ImportError: numpy.core.multiarray failed to import
- VirtualBox NS_ERROR_FAILURE (0x80004005) macOS
- Installing Homebrew on OS X
- ImportError: ‘No module named plotly.plotly’ in LinuxMint17.3
- No handles with labels found to put in legend
- How to plot a histogram using Matplotlib in Python with a list of data?
- You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory
- Plot logarithmic axes with matplotlib in python
- Python Traceback (most recent call last)
- In Matplotlib, what does the argument mean in fig.add_subplot(111)?
- import opencv vs import cv2
- python pip – install from local dir
- How can I plot a confusion matrix? [duplicate]