I've made my first plugin using plugin builder and I want to compile it. I read that I need two commands to do it under windows: pyuic4 and pyrcc4. But when I use any of these commands I get this:

D:\Programy\QGis\bin>pyuic4 -o C:\Users\noaal\.qgis2\python\plugins\Test\Test.py
ImportError: No module named site

I also read that I must change system path in windows, but I don't know to which location. So anyone have any clue?

  • You should have a Makefile file within the directory of your plugin. Have you tried using just $ make instead of running those 2 commands separately?
    – Joseph
    Oct 2, 2014 at 13:57
  • How do you use '$ make' in cmd? Oct 2, 2014 at 14:56
  • I will add this tutorial link although I think you might have got your information from here already: qgisworkshop.org/html/workshop/plugins_tutorial.html
    – Joseph
    Oct 2, 2014 at 15:07
  • Thanks a lot i did what you say and it worked. At first I don't have OSGeo4W, so there was a problem. BTW in windows you have to use only 'make' no '$ make'. Thanks again! Oct 2, 2014 at 15:16
  • Most welcome buddy! And thanks for the correction, it's been a while since I used the plugin builder so had to refresh my memory :). Will post the above comments as an answer to hopefully help others in a similar situation.
    – Joseph
    Oct 2, 2014 at 15:25

1 Answer 1


One method to compile custom-made plugins is to run the cmd prompt or the OSGeo4W shell via:

Start > QGIS folder > _OSGeo4W

Type cd, enter the directory of your plugin to make that the current directory and then type make. This should compile your plugin.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.