adouv
adouv

Reputation: 38

"No code object available" error when compiling .qrc file in PyQt5 using command line pyrcc

I am currently working on a PyQt5 project and following along with Martin Fitzpatrick's "Create GUI Applications with PyQt5", and I have encountered an error which seems a little confusing to me.

I have used Qt Creator (v. 4.13) to create .ui and .qrc files to be used for the project, which do not seem to have any errors in them (I have not modified them at all). I am able to compile the .ui files into .py class files without any issues using the following command (in the command line):

python -m PyQt5.uic.pyuic -x [filename].ui -o [FileName].py 

This runs without any issue, but when trying to compile .qrc files into .py resource files I get a "No code object available for PyQt5.pyrcc" when using a similar command:

python -m PyQt5.pyrcc -x resources.qrc -o resources.py

I am using a virtual environment created with Anaconda, to avoid messing around with the PATH variable and all the headaches that creates, and this environment is active when I run the command. It has no problem finding the PyQt5 package (importing PyQt5.uic.pyuic and PyQt5.pyrcc also work without any issue in the python terminal).

I have looked online for an answer, including here, but was not able to find anything that would help me understand precisely what is the source of this error, and if any solution exists that would not require altering the PATH variable (since that does not seem to be the issue from my understanding). Any help would be greatly appreciated. Thanks!

Upvotes: 0

Views: 462

Answers (0)

Related Questions