$ pip3 install objgraph --proxy="10.144.1.10:8080" Collecting objgraph Downloading https://files.pythonhosted.org/packages/ec/3d/c1f0e827dd2df27c8080317d667cb555d264825d/objgraph-3.4.0-py2.py3-none-any.whl Collecting graphviz (from objgraph) Downloading https://files.pythonhosted.org/packages/84/44/21a7fdd50841aaaef224b943f7d10df87e473d48/graphviz-0.8.3-py2.py3-none-any.whl Installing collected packages: graphviz, objgraph Successfully installed graphviz-0.8.3 objgraph-3.4.0
$ ls -l total 1 -rwxr-xr-x 1 guowli 1049089 143 May 23 16:54 TempTest.py* $ cat TempTest.py #! python3 # -*- coding: utf-8 -*- import objgraph x = [] y = [x, [x], dict(x=x)] objgraph.show_refs([y], filename='sample-graph.png') $ py -3 TempTest.py Graph written to C:\Users\guowli\AppData\Local\Temp\objgraph-i96a8ww9.dot (4 nodes) Image generated as sample-graph.png $ ls -l total 13 -rw-r--r-- 1 guowli 1049089 10398 May 23 16:56 sample-graph.png -rwxr-xr-x 1 guowli 1049089 143 May 23 16:54 TempTest.py* $
生成對象引用關係圖:node
'The command "{}" is required to be in your path.'.format(cmd)) pycallgraph.exceptions.PyCallGraphException: The command "dot" is required to be in your path.