Question:
1 fenglei@gpu01:~$ ipython
2 Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
3 Type "copyright", "credits" or "license" for more information.
4
5 IPython 5.1.0 -- An enhanced Interactive Python.
6 ? -> Introduction and overview of IPython's features.
7 %quickref -> Quick reference.
8 help -> Python's own help system.
9 object? -> Details about 'object', use 'object??' for extra details.
10
11 In [1]: import matplotlib.pyplot as plt
12
13 In [2]: QXcbConnection: Could not connect to display
14 Aborted (core dumped)
Solution:
1 fenglei@gpu01:~$ ipython
2 Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06)
3 Type "copyright", "credits" or "license" for more information.
4
5 IPython 5.1.0 -- An enhanced Interactive Python.
6 ? -> Introduction and overview of IPython's features.
7 %quickref -> Quick reference.
8 help -> Python's own help system.
9 object? -> Details about 'object', use 'object??' for extra details.
10
11 In [1]: import os
12
13 In [2]: os.environ['QT_QPA_PLATFORM']='offscreen'
14
15 In [3]: import matplotlib.pyplot as plt
Similar Posts:
- [Solved] pip install ipython error: ‘ImportError: No module named shutil_get_terminal_size’
- Python3: list dict set [UNK]unhashable type
- RuntimeError: Python is not installed as a framework [How to Solve]
- Solve the problem of attributeerror: module ‘Matplotlib’ has no attribute ‘verb
- [Solved] Python TensorFlow Error: ‘tensorflow.compat.v2.__internal__’ has no attribute ‘tf2’
- NameError: name ‘true’ is not defined when opening ipynb file in jupyter notebook
- [Solved] module functions cannot set METH_CLASS or METH_STATIC
- ImportError: No module named matplotlib.pyplot
- ImportError: cannot import name cbook