I have now spent the last hour or so trying to fix this issue but failed. I have read several related questions such as this, GitHub issues such as this but can't find how to best solve this issue.
Steps leading to the error
import matplotlib.pyplot as plt
Error message:
AttributeError: 'InputHookManager' object has no attribute '_stdin_file'
EDIT
- Importing as follows throws the same error(please see details of my system and failed attempts below):
from matplotlib import pyplot as plt
- It works at the Terminal
Failed attempts
I then opened the file that defines InputHookManager and noticed that it had something to do with ipython
and pydev
so I reinstalled ipython
but that didn't solve the issue.
I also tried reinstalling matplotlib
to no avail. The same error happens with seaborn
presumably because they both need to use gtk3.
More details about the system
python 3.6
pycharm community 2019.2.1
Ubuntu 18.04.3
matplotlib 3.1.1