14

I installed QGIS 3.0 on Windows 10. I get this error everytime i run the pyrcc4 or pyrcc5 command:

'pyrcc4' is not recognized as an internal or external command

Even if I find a place with a pyrcc4.exe file or a place with apyrcc5.bat file and add the path to the environment variables I get the same error.

In the previous installation of osgeo4w i had a pyqtdev folder or something similar appear I think it was on C/. Was there supposed to be such a folder, do I need to download pyqt separately?

7
  • you have a bats and a exe in bin folder,for example D:\OSGeo4W64\bin
    – Fran Raga
    Commented Mar 5, 2018 at 11:04
  • I have no pyrcc4 or pyrcc5 bat or exe in the bin folders...
    – Carmel Han
    Commented Mar 5, 2018 at 13:56
  • pyrcc5 are inside Python36\Scripts and pyrcc4 in a bin,try reinstall Qgis maybe
    – Fran Raga
    Commented Mar 5, 2018 at 14:04
  • 1
    I have a pyrcc5 in: C:\OSGeo4W64\apps\Python36\Scripts, but even though I add the path to the path & python path variables the command pyrcc5 is not recognized
    – Carmel Han
    Commented Mar 5, 2018 at 14:08
  • @Carmel Han Do you have a QGIS 2.x version also installed in your system? If answer is yes I have a solution.
    – xunilk
    Commented Mar 5, 2018 at 14:36

3 Answers 3

23

Try running a batch file with the following:

@echo off
call "C:\Program Files\QGIS 3.0\bin\o4w_env.bat"
call "C:\Program Files\QGIS 3.0\bin\qt5_env.bat"
call "C:\Program Files\QGIS 3.0\bin\py3_env.bat"

@echo on
pyrcc5 -o resources.py resources.qrc

either place the batch file in your directory with resources.py or type in an absolute path.

5
  • It works for me. I had another solution but this is better and quicker. +1.
    – xunilk
    Commented Mar 8, 2018 at 14:23
  • The problem is i also have folders missing. for example I am missing the folder of ".qgis2". That's why i think there is a problem with the instalation of Qgis 3.0.0
    – Carmel Han
    Commented Mar 11, 2018 at 11:40
  • do you mean C:\users\USERNAME\.qgis2? In QGIS3.0, this has been moved to C:\users\USERNAME\AppData\Roaming\QGIS\QGIS3
    – Kezah
    Commented Mar 11, 2018 at 22:02
  • Works great, but need to adjust the path in the calls to the installed qgis-version. I.e for me today c:\program files\qgis 3.10\bin Commented Jan 27, 2020 at 9:29
  • In case anyone is getting the following error - C:\PROGRA~1\QGIS3~1.10\apps\Python37\lib\site-packages\PyQt5\pyrcc_main.py: File does not exist 'resources.qrc' Do a search for 'resources.qrc'. I found it in the plugin that I had just created with QGIS plugin builder. Then, make sure to edit the batch file described above to point to the absolute path of resources.qrc. This solved my problem.
    – jonesy19
    Commented Jun 2, 2020 at 12:49
6

For an additional information for people using ubuntu you can install libs like this

sudo apt-get update
sudo apt-get install pyqt5-dev-tools
1

Kezah's answer applied for OSGeo4W64:

Try running a batch file with the following:

@echo off
call "C:\OSGeo4W64\bin\o4w_env.bat"
call "C:\OSGeo4W64\bin\qt5_env.bat"
call "C:\OSGeo4W64\bin\py3_env.bat"

@echo on
pyrcc5 -o resources.py resources.qrc

either place the batch file in your directory with resources.py or type in an absolute path.

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.