If you want to use pyretic controller, I suggest that you can download the VM image from sdnhub. But when you first run the pyretic controller, you may encounter a problem like the following figure.
You can refer to this webpage to install additional software packages. Then the problem can be fixed.
After installation, you can try the following example.
Open another terminal to run the mininet.
Dr. Chih-Heng Ke
Department of Computer Science and Information Engineering, National Quemoy University, Kinmen, Taiwan