Generating a PNG with matplotlib when DISPLAY is undefined

前端 未结 12 1410
感动是毒
感动是毒 2020-11-22 02:51

I am trying to use networkx with Python. When I run this program it get this error. Is there anything missing?

#!/usr/bin/env python

import networkx as nx
i         


        
12条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 03:12

    What system are you on? It looks like you have a system with X11, but the DISPLAY environment variable was not properly set. Try executing the following command and then rerunning your program:

    export DISPLAY=localhost:0
    

提交回复
热议问题