1. dirkbaechle
  2. SCons_Qt4
  3. Issues
Issue #4 invalid

No tool named 'qt4': not a Zip file

dirkbaechle
repo owner created an issue

Reported originally by Bastian Gerholt:

Following the manual for the qt4-tool I tried to compile my source files. When I typed "scons" into the terminal, following error message occurred:

EnvironmentError: No tool named 'qt4': not a Zip file: File "/home/bastian/uni/bachelor/traffX/SConstruct", line 37: qtEnv.Tool('qt4') File "/usr/local/lib/scons-2.0.1/SCons/Environment.py", line 1691: tool = SCons.Tool.Tool(tool, toolpath, **kw) File "/usr/local/lib/scons-2.0.1/SCons/Tool/init.py", line 94: module = self._tool_module() File "/usr/local/lib/scons-2.0.1/SCons/Tool/init.py", line 154: raise SCons.Errors.EnvironmentError(m)

I don't know if this is a real bug or if I just failed to install the qt4 tool properly. The latter I did by copying the init.py file into the folder that contains my SConstruct file as I did not find any installation instructions for the tool.

Comments (7)

  1. dirkbaechle reporter

    Hi Bastian,

    the problems you encountered are not really qt4 specific. The Qt4 Tool, and all other entries on the ToolsIndex page of the SCons Wiki, are meant to be distributed as Python packages. This is why the py file is named init.py, and not qt4.py.

    For your single case, please create a folder "scons_site/scons_tools/qt4" (in your project folder, along the SConstruct file) and put the init.py in there. This should get you going... When using the latest checkpoint release of SCons, you could also create a config directory ".scons/scons_site/scons_tools/" in your home directory.

    For more infos, please read

    http://scons.org/wiki/ToolsIndex http://scons.org/doc/production/HTML/scons-user/x3697.html

    Best regards,

    Dirk

  2. dirkbaechle reporter

    Bastian:

    Hi Dirk,

    sorry, I didn't know about this fact. Maybe the manual could befinit from a short hint on how to install the tool or where to find such instructions. Anyway I created the folder/file-structure that you suggested and additionaly read the guide of chapter 19.7. From what was written there I suppose that the tool belongs to the generate-exist category. Therefore the tool should - if I literally sticked to the guide - be installed in site_scons/site_tools/qt4.py. Thus I tried both approaches and neither worked. Do I have to configure something else, say the site_scons/site_init.py file (this was only described for Environment-tools)?

    Best regards, Bastian

  3. dirkbaechle reporter

    Russel Winder:

    The documentation for the current (as at 2010-12-03) production version of SCons (2.0.1) is woefully out of date, and hence woefully inadequate. There is an assumption in this documentation that the tool must be a Python module, which is not the case, a tool can either be a Python module or a Python package. You may want to take a peek at 17.7 of the "next version" documentation (currently 2.1.0) as at least it has a few updates!

    The upshot of all this is that the best way of "installing" a tool is to clone the repository into the directory site_scons/site_tools/qt4. Not only does this get a known to be working installation, it allows you to update to the latest version as and when.

    I hope this helps.

  4. dirkbaechle reporter

    Please try to get the simple example in the "test/basic/moc-from-header/image" folder working first, just the way you did with your own project (You'll have to copy the file "test/qtenv.py" into the "image" folder!). If this still fails, you can send me your version of the example as testcase. Then I'll check whether it is set up correctly.

    Thanks,

    Dirk

  5. dirkbaechle reporter

    Bastian:

    Hi Dirk,

    I tried to get the example working but failed again. So I follow your suggestion by sending you a copy of my qt4 Tool. If it's working on your machine could it be a version issue between python and qt4-Tool or SCons and the tool?

    I'm currently using SCons: script: v2.0.1.r5134 engine: v2.0.1.r5134 And my python version number is: Python 2.6.5

    In the image-directory you will find a file named errormsg.txt which shows you what I typed and received as an answer.

    Thank you for your help, Bastian

  6. dirkbaechle reporter

    Hi Bastian,

    thanks for the files. When trying to start the test, your current working directory is "/home/bastian/uni/bachelor/traffX/scons_site/scons_tools/qt4/test/basic/moc-from-header/image/"...so I wonder whether I probably confused you with my first reply. It has an error in it: the names of the subfolders should be "site_scons/site_tools", and *not* "scons_site/scons_tools". Sorry, my fault...

    Please, correct the folder names in your traffX directory, such that the qt4 Tool is located at "/home/bastian/uni/bachelor/traffX/site_scons/site_tools/qt4".

    Forget about the tests or differences between Python versions...it should work like this.

    Good luck,

    Dirk

  7. dirkbaechle reporter

    Bastian:

    Hi Dirk,

    I followed your suggestion but this didn't work - once again. So I took a closer look at the error message and then I decided to investigate the file which caused the message: "/usr/local/lib/scons-2.0.1/SCons/Tool/init.py". I inserted two lines with print statements to understand where the program searched for the qt4 tool. This seemed to be the same folder as the one from above. Thus I simply copied the qt4 folder to "/usr/local/lib/scons-2.0.1/SCons/Tool/qt4" and voila, it worked! I hope that this won't change during my error correction process of the source code of my program :-). So I guess the path for the program to look for other tools - as in my case the qt4 tool - needs to be changed to achieve the behaviour that you described.

    Best wishes, Bastian

  8. Log in to comment