No tool named 'qt4': not a Zip file

Bug #684655 reported by Bastian Gorholt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SCons Qt4 Tool
Invalid
Undecided
Unassigned

Bug Description

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.

Revision history for this message
Dirk Baechle (dl9obn) wrote :

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

Changed in scons-qt4:
status: New → Invalid
Revision history for this message
Bastian Gorholt (chuckythefarcimen) wrote : Re: [Bug 684655] Re: No tool named 'qt4': not a Zip file

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

2010/12/3 Dirk Baechle <email address hidden>:
> 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
>
>
> ** Changed in: scons-qt4
>       Status: New => Invalid
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/684655
>
> Title:
>  No tool named 'qt4': not a Zip file
>
> Status in SCons Qt4 Tool:
>  Invalid
>
> Bug description:
>  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.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/scons-qt4/+bug/684655/+subscribe
>

Revision history for this message
Russel Winder (russel) wrote :

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.

Revision history for this message
Dirk Baechle (dl9obn) wrote :

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

Revision history for this message
Bastian Gorholt (chuckythefarcimen) wrote :

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

2010/12/3 Dirk Baechle <email address hidden>:
> 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
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/684655
>
> Title:
>  No tool named 'qt4': not a Zip file
>
> Status in SCons Qt4 Tool:
>  Invalid
>
> Bug description:
>  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.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/scons-qt4/+bug/684655/+subscribe
>

Revision history for this message
Dirk Baechle (dl9obn) wrote :

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

Revision history for this message
Bastian Gorholt (chuckythefarcimen) wrote :

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

2010/12/3 Dirk Baechle <email address hidden>:
> 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
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/684655
>
> Title:
>  No tool named 'qt4': not a Zip file
>
> Status in SCons Qt4 Tool:
>  Invalid
>
> Bug description:
>  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.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/scons-qt4/+bug/684655/+subscribe
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.