File: installation.html

package info (click to toggle)
python-qt4 4.11.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 39,748 kB
  • ctags: 6,146
  • sloc: python: 125,938; cpp: 12,612; xml: 292; makefile: 258; php: 27; sh: 27
file content (879 lines) | stat: -rw-r--r-- 62,330 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Installing PyQt4 &mdash; PyQt 4.11.2 Reference Guide</title>
    
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '4.11.2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="shortcut icon" href="_static/logo_tn.ico"/>
    <link rel="top" title="PyQt 4.11.2 Reference Guide" href="index.html" />
    <link rel="next" title="PyQt4 and Python v3" href="python_v3.html" />
    <link rel="prev" title="Potential Incompatibilities with Earlier Versions" href="incompatibilities.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="python_v3.html" title="PyQt4 and Python v3"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="incompatibilities.html" title="Potential Incompatibilities with Earlier Versions"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">PyQt 4.11.2 Reference Guide</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="installing-pyqt4">
<h1>Installing PyQt4<a class="headerlink" href="#installing-pyqt4" title="Permalink to this headline">¶</a></h1>
<div class="section" id="downloading-sip">
<h2>Downloading SIP<a class="headerlink" href="#downloading-sip" title="Permalink to this headline">¶</a></h2>
<p>SIP must be installed before building and using PyQt4.  You can get the latest
release of the SIP source code from
<a class="reference external" href="http://www.riverbankcomputing.com/software/sip/download">http://www.riverbankcomputing.com/software/sip/download</a>.</p>
<p>The SIP documentation can be found at <a class="reference external" href="http://pyqt.sourceforge.net/Docs/sip4/">http://pyqt.sourceforge.net/Docs/sip4/</a>.</p>
</div>
<div class="section" id="downloading-pyqt4">
<h2>Downloading PyQt4<a class="headerlink" href="#downloading-pyqt4" title="Permalink to this headline">¶</a></h2>
<p>You can get the latest release of the GPL version of the PyQt4 source code from
<a class="reference external" href="http://www.riverbankcomputing.com/software/pyqt/download">http://www.riverbankcomputing.com/software/pyqt/download</a>.</p>
<p>If you are using the commercial version of PyQt4 then you should use the
download instructions which were sent to you when you made your purchase.  You
must also download your license file.</p>
</div>
<div class="section" id="configuring-pyqt4">
<h2>Configuring PyQt4<a class="headerlink" href="#configuring-pyqt4" title="Permalink to this headline">¶</a></h2>
<p>After unpacking the source package (either a <tt class="docutils literal"><span class="pre">.tar.gz</span></tt> or a <tt class="docutils literal"><span class="pre">.zip</span></tt> file
depending on your platform) you should then check for any <tt class="file docutils literal"><span class="pre">README</span></tt> files
that relate to your platform.</p>
<p>If you are using the commercial version of PyQt4 then you must copy your
license file to the <tt class="file docutils literal"><span class="pre">sip</span></tt> directory.</p>
<p>You need to make sure your environment variables are set properly for your
development environment.</p>
<p>In order to configure the build of PyQt4 you need to run either the
<strong class="program">configure-ng.py</strong> or the <strong class="program">configure.py</strong> script.</p>
<p><strong class="program">configure.py</strong> is the original configuration script that uses the
build system of SIP v4 (i.e. the <tt class="xref py py-mod docutils literal"><span class="pre">sip.sipconfig</span></tt> module).  It will be
supported for the life of PyQt4.</p>
<p><strong class="program">configure-ng.py</strong> is the new configuration script that uses Qt&#8217;s
<strong class="program">qmake</strong> program to do all the heavy lifting.  It has the following
advantages:</p>
<ul class="simple">
<li>it supports cross-compilation</li>
<li>it is the basis of PyQt5&#8217;s configuration script</li>
<li>generated Makefiles have an uninstall target</li>
<li>it will work with SIP v5 (which will have no build system).</li>
</ul>
<p>Users are encouraged to switch to using <strong class="program">configure-ng.py</strong> in order to
ease the future transition to SIP v5 and/or PyQt5.</p>
<div class="section" id="using-configure-ng-py">
<h3>Using <strong class="program">configure-ng.py</strong><a class="headerlink" href="#using-configure-ng-py" title="Permalink to this headline">¶</a></h3>
<div class="versionadded">
<p><span class="versionmodified">New in version 4.10.1.</span></p>
</div>
<p>The <strong class="program">configure-ng.py</strong> script is used to configure PyQt4 as follows:</p>
<div class="highlight-python"><div class="highlight"><pre>python configure-ng.py
</pre></div>
</div>
<p>This assumes that the Python interpreter is on your path.  Something like the
following may be appropriate on Windows:</p>
<div class="highlight-python"><div class="highlight"><pre>c:\python34\python configure-ng.py
</pre></div>
</div>
<p>If you have multiple versions of Python installed then make sure you use the
interpreter for which you wish to build PyQt4 for.</p>
<p>The full set of command line options is:</p>
<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--assume-shared">
<tt class="descname">--assume-shared</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--assume-shared" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally Qt is checked to see if it has been built as shared libraries.
Some Linux distributions configure their Qt builds to make this check
unreliable.  This option ignores the result of the check and assumes that
Qt has been built as shared libraries.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--bindir">
<span id="cmdoption-configure-ng.py-b"></span><tt class="descname">--bindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-b</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--bindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">pyuic4</strong>, <strong class="program">pyrcc4</strong> and <strong class="program">pylupdate4</strong>
utilities will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--concatenate">
<span id="cmdoption-configure-ng.py-c"></span><tt class="descname">--concatenate</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-c</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--concatenate" title="Permalink to this definition">¶</a></dt>
<dd><p>The C++ source files for a Python module will be concatenated.  This
results in significantly reduced compilation times.  Most, but not all,
C++ compilers can handle the large files that result.  See also the
<a class="reference internal" href="#cmdoption-configure-ng.py--concatenate-split"><em class="xref std std-option">--concatenate-split</em></a> option.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--concatenate-split">
<span id="cmdoption-configure-ng.py-j"></span><tt class="descname">--concatenate-split</tt><tt class="descclassname"> &lt;N&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-j</tt><tt class="descclassname"> &lt;N&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--concatenate-split" title="Permalink to this definition">¶</a></dt>
<dd><p>If the <a class="reference internal" href="#cmdoption-configure-ng.py--concatenate"><em class="xref std std-option">--concatenate</em></a> option is used to concatenate the C++ source
files then this option determines how many files are created.  The default
is 1.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--configuration">
<tt class="descname">--configuration</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--configuration" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">&lt;FILE&gt;</span></tt> contains the configuration of the PyQt4 build to be used instead
of dynamically introspecting the system and is typically used when
cross-compiling.  See <a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--confirm-license">
<tt class="descname">--confirm-license</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--confirm-license" title="Permalink to this definition">¶</a></dt>
<dd><p>Using this confirms that you accept the terms of the PyQt4 license.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--dbus">
<span id="cmdoption-configure-ng.py-s"></span><tt class="descname">--dbus</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-s</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--dbus" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">dbus-python.h</span></tt> header file of the dbus-python package can be
found in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;/dbus</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--debug">
<span id="cmdoption-configure-ng.py-u"></span><tt class="descname">--debug</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-u</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--debug" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will be built with debugging symbols.  On Windows this
requires that a debug version of Python is installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--designer-plugindir">
<tt class="descname">--designer-plugindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--designer-plugindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The Python plugin for Qt Designer will be installed in the directory
<tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--destdir">
<span id="cmdoption-configure-ng.py-d"></span><tt class="descname">--destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-d</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 Python package will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.  The
default is the Python installation&#8217;s <tt class="file docutils literal"><span class="pre">site-packages</span></tt> directory.  If
you use this option then the <span class="target" id="index-0"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></tt> environment variable must
include <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--enable">
<span id="cmdoption-configure-ng.py-e"></span><tt class="descname">--enable</tt><tt class="descclassname"> &lt;MODULE&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-e</tt><tt class="descclassname"> &lt;MODULE&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--enable" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally all PyQt4 modules are enabled and are built if the corresponding
Qt library can be found.  Using this option only those modules specifically
enabled will be checked for and built.  The option may be specified any
number of times.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--help">
<span id="cmdoption-configure-ng.py-h"></span><tt class="descname">--help</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-h</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--help" title="Permalink to this definition">¶</a></dt>
<dd><p>Display a help message.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-deprecated">
<tt class="descname">--no-deprecated</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-deprecated" title="Permalink to this definition">¶</a></dt>
<dd><p>All Qt v4 features that have been deprecated in Qt v5 will be disabled.
This is useful when porting PyQt4 applications to PyQt5.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-designer-plugin">
<tt class="descname">--no-designer-plugin</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-designer-plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>The Qt Designer plugin will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-docstrings">
<tt class="descname">--no-docstrings</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-docstrings" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will not contain automatically generated docstrings.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-qsci-api">
<tt class="descname">--no-qsci-api</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt4.api</span></tt> QScintilla API file is not installed even if
QScintilla does appear to be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-sip-files">
<tt class="descname">--no-sip-files</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-sip-files" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt4 modules will not be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-tools">
<tt class="descname">--no-tools</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-tools" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.11.</span></p>
</div>
<p>The <tt class="docutils literal"><span class="pre">pyuic4</span></tt>, <tt class="docutils literal"><span class="pre">pyrcc4</span></tt> and <tt class="docutils literal"><span class="pre">pylupdate4</span></tt> tools will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--no-timestamp">
<span id="cmdoption-configure-ng.py-T"></span><tt class="descname">--no-timestamp</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-T</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--no-timestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally the header comments of each generated C/C++ source file includes
a timestamp corresponding to when the file was generated.  This option
suppresses the inclusion of the timestamp.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--plugin">
<span id="cmdoption-configure-ng.py-t"></span><tt class="descname">--plugin</tt><tt class="descclassname"> &lt;PLUGIN&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-t</tt><tt class="descclassname"> &lt;PLUGIN&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>If Qt has been built as static libraries then the static plugin
<tt class="docutils literal"><span class="pre">&lt;PLUGIN&gt;</span></tt> will be linked with the appropriate PyQt4 module.  The option
may be specified any number of times.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--protected-is-public">
<tt class="descname">--protected-is-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--protected-is-public" title="Permalink to this definition">¶</a></dt>
<dd><p>On certain platforms the size of PyQt4 modules can be significantly reduced
by redefining the C++ <tt class="docutils literal"><span class="pre">protected</span></tt> keyword as <tt class="docutils literal"><span class="pre">public</span></tt> during
compilation.  This option enables this behaviour and is the default on
Linux and MacOS/X.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--protected-not-public">
<tt class="descname">--protected-not-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--protected-not-public" title="Permalink to this definition">¶</a></dt>
<dd><p>The default redefinition of <tt class="docutils literal"><span class="pre">protected</span></tt> to <tt class="docutils literal"><span class="pre">public</span></tt> during compilation
on Linux and MacOS/X is disabled.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--pyuic4-interpreter">
<tt class="descname">--pyuic4-interpreter</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--pyuic4-interpreter" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">&lt;FILE&gt;</span></tt> is the name of the Python interpreter used in the pyuic4
wrapper.  The default is platform dependent.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--qmake">
<span id="cmdoption-configure-ng.py-q"></span><tt class="descname">--qmake</tt><tt class="descclassname"> &lt;FILE&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-q</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--qmake" title="Permalink to this definition">¶</a></dt>
<dd><p>Qt&#8217;s <strong class="program">qmake</strong> program is used to determine how your Qt installation
is laid out.  Normally <strong class="program">qmake</strong> is found on your <span class="target" id="index-1"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.
This option can be used to specify a particular instance of
<strong class="program">qmake</strong> to use.  This option is not available on Windows where
<strong class="program">qmake</strong> must be on <span class="target" id="index-2"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--qsci-api">
<span id="cmdoption-configure-ng.py-a"></span><tt class="descname">--qsci-api</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-a</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt4.api</span></tt> QScintilla API file is installed even if QScintilla
does not appear to be installed.  This option is implied if the
<a class="reference internal" href="#cmdoption-configure-ng.py--qsci-api-destdir"><em class="xref std std-option">--qsci-api-destdir</em></a> option is specified.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--qsci-api-destdir">
<span id="cmdoption-configure-ng.py-n"></span><tt class="descname">--qsci-api-destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-n</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--qsci-api-destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The QScintilla API file will be installed in the <tt class="file docutils literal"><span class="pre">python</span></tt>
subdirectory of the <tt class="file docutils literal"><span class="pre">api</span></tt> subdirectory of the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--sip">
<tt class="descname">--sip</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--sip" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">sip</strong> program is used to generate PyQt4&#8217;s C++ source code.
Normally <strong class="program">sip</strong> is found on your <span class="target" id="index-3"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.  This option can
be used to specify a particular instance of <strong class="program">sip</strong> to use.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--sip-incdir">
<tt class="descname">--sip-incdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--sip-incdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">sip.h</span></tt> header file can be found in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--sipdir">
<span id="cmdoption-configure-ng.py-v"></span><tt class="descname">--sipdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-v</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--sipdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt4 modules will be installed in the directory
<tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--spec">
<tt class="descname">--spec</tt><tt class="descclassname"> &lt;SPEC&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--spec" title="Permalink to this definition">¶</a></dt>
<dd><p>The argument <tt class="docutils literal"><span class="pre">-spec</span> <span class="pre">SPEC</span></tt> will be passed to <strong class="program">qmake</strong>.  The
default behaviour is platform specific.  On Windows
<strong class="program">configure-ng.py</strong> will choose the value that is correct for the
version of Python that is being used.  (However if you have built Python
yourself then you may need to explicitly specify <tt class="docutils literal"><span class="pre">&lt;SPEC&gt;</span></tt>.)  On MacOS
<strong class="program">configure-ng.py</strong> will try and avoid <tt class="docutils literal"><span class="pre">macx-xcode</span></tt> if possible.)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--static">
<span id="cmdoption-configure-ng.py-k"></span><tt class="descname">--static</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-k</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--static" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will be built as static libraries.  This is useful when
building a custom interpreter with the PyQt4 modules built in to the
interpreter.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--sysroot">
<tt class="descname">--sysroot</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--sysroot" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.11.</span></p>
</div>
<p><tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt> is the name of an optional directory that replaces <tt class="docutils literal"><span class="pre">sys.prefix</span></tt>
in the names of other directories (specifically those specifying where the
various PyQt4 components will be installed and where the Python include and
library directories can be found).  It is typically used when
cross-compiling or when building a static version of PyQt4.  See
<a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--target-py-version">
<tt class="descname">--target-py-version</tt><tt class="descclassname"> &lt;VERSION&gt;</tt><a class="headerlink" href="#cmdoption-configure-ng.py--target-py-version" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.11.</span></p>
</div>
<p><tt class="docutils literal"><span class="pre">&lt;VERSION&gt;</span></tt> is the major and minor version (e.g. <tt class="docutils literal"><span class="pre">3.4</span></tt>) of the version
of Python being targetted.  By default the version of Python being used to
run the <strong class="program">configure.py</strong> script is used.  It is typically used when
cross-compiling.  See <a class="reference internal" href="#ref-configuration-files"><em>Configuring with Configuration Files</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--trace">
<span id="cmdoption-configure-ng.py-r"></span><tt class="descname">--trace</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-r</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--trace" title="Permalink to this definition">¶</a></dt>
<dd><p>The generated PyQt4 modules contain additional tracing code that is enabled
using SIP&#8217;s <tt class="xref py py-func docutils literal"><span class="pre">sip.settracemask()</span></tt> function.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--verbose">
<span id="cmdoption-configure-ng.py-w"></span><tt class="descname">--verbose</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-w</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--verbose" title="Permalink to this definition">¶</a></dt>
<dd><p>Compiler commands and any output issued during configuration is displayed
instead of being suppressed.  Use this if <strong class="program">configure-ng.py</strong> is
having problems to see what exactly is going wrong.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng.py--version">
<tt class="descname">--version</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure-ng.py--version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the PyQt4 version number.</p>
</dd></dl>

<p>Any remaining command line arguments are expected to be in the form
<tt class="docutils literal"><span class="pre">name=value</span></tt> or <tt class="docutils literal"><span class="pre">name+=value</span></tt>.  Such arguments are added to any
<strong class="program">qmake</strong> <tt class="docutils literal"><span class="pre">.pro</span></tt> file created by <strong class="program">configure-ng.py</strong>.</p>
</div>
<div class="section" id="using-configure-py">
<h3>Using <strong class="program">configure.py</strong><a class="headerlink" href="#using-configure-py" title="Permalink to this headline">¶</a></h3>
<p>The <strong class="program">configure.py</strong> script is used to configure PyQt4 as follows:</p>
<div class="highlight-python"><div class="highlight"><pre>python configure.py
</pre></div>
</div>
<p>This assumes that the Python interpreter is on your path.  Something like the
following may be appropriate on Windows:</p>
<div class="highlight-python"><div class="highlight"><pre>c:\python34\python configure.py
</pre></div>
</div>
<p>If you have multiple versions of Python installed then make sure you use the
interpreter for which you wish to build PyQt4 for.</p>
<p>The full set of command line options is:</p>
<dl class="cmdoption">
<dt id="cmdoption-configure.py--assume-shared">
<tt class="descname">--assume-shared</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--assume-shared" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally Qt is checked to see if it has been built as shared libraries.
Some Linux distributions configure their Qt builds to make this check
unreliable.  This option ignores the result of the check and assumes that
Qt has been built as shared libraries.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--bindir">
<span id="cmdoption-configure.py-b"></span><tt class="descname">--bindir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-b</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--bindir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <strong class="program">pyuic4</strong>, <strong class="program">pyrcc4</strong> and <strong class="program">pylupdate4</strong>
utilities will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--concatenate">
<span id="cmdoption-configure.py-c"></span><tt class="descname">--concatenate</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-c</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--concatenate" title="Permalink to this definition">¶</a></dt>
<dd><p>The C++ source files for a Python module will be concatenated.  This
results in significantly reduced compilation times.  Most, but not all,
C++ compilers can handle the large files that result.  See also the
<a class="reference internal" href="#cmdoption-configure.py--concatenate-split"><em class="xref std std-option">--concatenate-split</em></a> option.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--concatenate-split">
<span id="cmdoption-configure.py-j"></span><tt class="descname">--concatenate-split</tt><tt class="descclassname"> &lt;N&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-j</tt><tt class="descclassname"> &lt;N&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--concatenate-split" title="Permalink to this definition">¶</a></dt>
<dd><p>If the <a class="reference internal" href="#cmdoption-configure.py--concatenate"><em class="xref std std-option">--concatenate</em></a> option is used to concatenate the C++ source
files then this option determines how many files are created.  The default
is 1.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--confirm-license">
<tt class="descname">--confirm-license</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--confirm-license" title="Permalink to this definition">¶</a></dt>
<dd><p>Using this confirms that you accept the terms of the PyQt4 license.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--consolidate">
<span id="cmdoption-configure.py-g"></span><tt class="descname">--consolidate</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-g</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--consolidate" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally each PyQt4 module (except for the <tt class="xref py py-mod docutils literal"><span class="pre">Qt</span></tt> module) is
linked against the corresponding Qt library.  This option creates a module
called <tt class="xref py py-mod docutils literal"><span class="pre">_qt</span></tt> which is linked against all the required Qt
libraries and the other modules are stub modules that populate their module
dictionaries from this one.  This is useful when linking against static Qt
libraries to eliminate the need to distribute the Qt libraries while
minimising the memory footprint of the PyQt4 modules.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--dbus">
<span id="cmdoption-configure.py-s"></span><tt class="descname">--dbus</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-s</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--dbus" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">dbus-python.h</span></tt> header file of the dbus-python package can be
found in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;/dbus</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--debug">
<span id="cmdoption-configure.py-u"></span><tt class="descname">--debug</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-u</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--debug" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will be built with debugging symbols.  On Windows this
requires that a debug version of Python is installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--destdir">
<span id="cmdoption-configure.py-d"></span><tt class="descname">--destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-d</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 Python package will be installed in the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.  The
default is the Python installation&#8217;s <tt class="file docutils literal"><span class="pre">site-packages</span></tt> directory.  If
you use this option then the <span class="target" id="index-4"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></tt> environment variable must
include <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--enable">
<span id="cmdoption-configure.py-e"></span><tt class="descname">--enable</tt><tt class="descclassname"> &lt;MODULE&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-e</tt><tt class="descclassname"> &lt;MODULE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--enable" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally all PyQt4 modules are enabled and are built if the corresponding
Qt library can be found.  Using this option only those modules specifically
enabled will be checked for and built.  The option may be specified any
number of times.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--help">
<span id="cmdoption-configure.py-h"></span><tt class="descname">--help</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-h</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--help" title="Permalink to this definition">¶</a></dt>
<dd><p>Display a help message.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-deprecated">
<tt class="descname">--no-deprecated</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-deprecated" title="Permalink to this definition">¶</a></dt>
<dd><p>All Qt v4 features that have been deprecated in Qt v5 will be disabled.
This is useful when porting PyQt4 applications to PyQt5.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-designer-plugin">
<tt class="descname">--no-designer-plugin</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-designer-plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>The Qt Designer plugin will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-docstrings">
<tt class="descname">--no-docstrings</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-docstrings" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will not contain automatically generated docstrings.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-qsci-api">
<tt class="descname">--no-qsci-api</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt4.api</span></tt> QScintilla API file is not installed even if
QScintilla does appear to be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-sip-files">
<tt class="descname">--no-sip-files</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-sip-files" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt4 modules will not be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--no-timestamp">
<span id="cmdoption-configure.py-T"></span><tt class="descname">--no-timestamp</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-T</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--no-timestamp" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally the header comments of each generated C/C++ source file includes
a timestamp corresponding to when the file was generated.  This option
suppresses the inclusion of the timestamp.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--plugin">
<span id="cmdoption-configure.py-t"></span><tt class="descname">--plugin</tt><tt class="descclassname"> &lt;PLUGIN&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-t</tt><tt class="descclassname"> &lt;PLUGIN&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--plugin" title="Permalink to this definition">¶</a></dt>
<dd><p>If Qt has been built as static libraries then the static plugin
<tt class="docutils literal"><span class="pre">&lt;PLUGIN&gt;</span></tt> will be linked with the appropriate PyQt4 module.  The option
may be specified any number of times.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--plugin-destdir">
<span id="cmdoption-configure.py-p"></span><tt class="descname">--plugin-destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-p</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--plugin-destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The Qt Designer plugin that manages plugins implemented in Python will be
installed in the <tt class="file docutils literal"><span class="pre">designer</span></tt> subdirectory of the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--protected-is-public">
<tt class="descname">--protected-is-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--protected-is-public" title="Permalink to this definition">¶</a></dt>
<dd><p>On certain platforms the size of PyQt4 modules can be significantly reduced
by redefining the C++ <tt class="docutils literal"><span class="pre">protected</span></tt> keyword as <tt class="docutils literal"><span class="pre">public</span></tt> during
compilation.  This option enables this behaviour and is the default on
Linux and MacOS/X.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--protected-not-public">
<tt class="descname">--protected-not-public</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--protected-not-public" title="Permalink to this definition">¶</a></dt>
<dd><p>The default redefinition of <tt class="docutils literal"><span class="pre">protected</span></tt> to <tt class="docutils literal"><span class="pre">public</span></tt> during compilation
on Linux and MacOS/X is disabled.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qmake">
<span id="cmdoption-configure.py-q"></span><tt class="descname">--qmake</tt><tt class="descclassname"> &lt;FILE&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-q</tt><tt class="descclassname"> &lt;FILE&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--qmake" title="Permalink to this definition">¶</a></dt>
<dd><p>Qt&#8217;s <strong class="program">qmake</strong> program is used to determine how your Qt installation
is laid out.  Normally <strong class="program">qmake</strong> is found on your <span class="target" id="index-5"></span><tt class="xref std std-envvar docutils literal"><span class="pre">PATH</span></tt>.
This option can be used to specify a particular instance of
<strong class="program">qmake</strong> to use.  This option is not available on Windows.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qsci-api">
<span id="cmdoption-configure.py-a"></span><tt class="descname">--qsci-api</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-a</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="file docutils literal"><span class="pre">PyQt4.api</span></tt> QScintilla API file is installed even if QScintilla
does not appear to be installed.  This option is implied if the
<a class="reference internal" href="#cmdoption-configure.py--qsci-api-destdir"><em class="xref std std-option">--qsci-api-destdir</em></a> option is specified.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--qsci-api-destdir">
<span id="cmdoption-configure.py-n"></span><tt class="descname">--qsci-api-destdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-n</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--qsci-api-destdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The QScintilla API file will be installed in the <tt class="file docutils literal"><span class="pre">python</span></tt>
subdirectory of the <tt class="file docutils literal"><span class="pre">api</span></tt> subdirectory of the directory <tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--sipdir">
<span id="cmdoption-configure.py-v"></span><tt class="descname">--sipdir</tt><tt class="descclassname"> &lt;DIR&gt;</tt><tt class="descclassname">, </tt><tt class="descname">-v</tt><tt class="descclassname"> &lt;DIR&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--sipdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="docutils literal"><span class="pre">.sip</span></tt> files for the PyQt4 modules will be installed in the directory
<tt class="docutils literal"><span class="pre">&lt;DIR&gt;</span></tt>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--static">
<span id="cmdoption-configure.py-k"></span><tt class="descname">--static</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-k</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--static" title="Permalink to this definition">¶</a></dt>
<dd><p>The PyQt4 modules will be built as static libraries.  This is useful when
building a custom interpreter with the PyQt4 modules built in to the
interpreter.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--trace">
<span id="cmdoption-configure.py-r"></span><tt class="descname">--trace</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-r</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--trace" title="Permalink to this definition">¶</a></dt>
<dd><p>The generated PyQt4 modules contain additional tracing code that is enabled
using SIP&#8217;s <tt class="xref py py-func docutils literal"><span class="pre">sip.settracemask()</span></tt> function.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--use-arch">
<tt class="descname">--use-arch</tt><tt class="descclassname"> &lt;ARCH&gt;</tt><a class="headerlink" href="#cmdoption-configure.py--use-arch" title="Permalink to this definition">¶</a></dt>
<dd><p>When <strong class="program">pyuic4</strong> calls the Python interpreter on MacOS it will be run
using the architecture <tt class="docutils literal"><span class="pre">&lt;ARCH&gt;</span></tt>.  See the section <a class="reference internal" href="#ref-macos"><em>Configuring SIP and PyQt4 for MacOS</em></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--verbose">
<span id="cmdoption-configure.py-w"></span><tt class="descname">--verbose</tt><tt class="descclassname"></tt><tt class="descclassname">, </tt><tt class="descname">-w</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--verbose" title="Permalink to this definition">¶</a></dt>
<dd><p>Compiler commands and any output issued during configuration is displayed
instead of being suppressed.  Use this if <strong class="program">configure.py</strong> is having
problems to see what exactly is going wrong.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure.py--version">
<tt class="descname">--version</tt><tt class="descclassname"></tt><a class="headerlink" href="#cmdoption-configure.py--version" title="Permalink to this definition">¶</a></dt>
<dd><p>Display the PyQt4 version number.</p>
</dd></dl>

</div>
<div class="section" id="configuring-sip-and-pyqt4-for-macos">
<span id="ref-macos"></span><h3>Configuring SIP and PyQt4 for MacOS<a class="headerlink" href="#configuring-sip-and-pyqt4-for-macos" title="Permalink to this headline">¶</a></h3>
<p>Note that this section only applies if you are using the
<strong class="program">configure.py</strong> script to configure PyQt4.  The
<strong class="program">configure-ng.py</strong> script leaves it to Qt&#8217;s <strong class="program">qmake</strong> program to
handle the details.  <strong class="program">configure-ng.py</strong> does not support the creation
of universal binaries.</p>
<p>Building applications for MacOS can be a complex process.  Typically the
following need to be taken into account:</p>
<ul class="simple">
<li>the architectures (i.e. i386, x86_64, ppc) that you want to support</li>
<li>the earliest version of MacOS you want to support (i.e. the deployment
target)</li>
<li>the version of the SDK you want to use.</li>
</ul>
<p>If you are using a binary installer for Python and/or Qt then you also need to
consider how they have been built regarding the above, and what bugs they have.</p>
<p>SIP&#8217;s and PyQt4&#8217;s <strong class="program">configure.py</strong> scripts provide the necessary command
line options to allow the correct configurations to be specified - the trick is
to work out which options to use depending on the versions of Python and Qt you
have installed.</p>
<p>SIP provides the following command line options to its <strong class="program">configure.py</strong>
script.</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">--arch</span> <span class="pre">&lt;ARCH&gt;</span></tt> specifies the target architecture and may be specified a
number of times.</li>
<li><tt class="docutils literal"><span class="pre">--universal</span></tt> is a shortcut for <tt class="docutils literal"><span class="pre">--arch</span> <span class="pre">i386</span> <span class="pre">--arch</span> <span class="pre">ppc</span></tt>.</li>
<li><tt class="docutils literal"><span class="pre">--deployment-target</span> <span class="pre">&lt;VERSION&gt;</span></tt> specifies the earliest version of MacOS you
want to support.  This sets the <span class="target" id="index-6"></span><tt class="xref std std-envvar docutils literal"><span class="pre">MACOSX_DEPLOYMENT_TARGET</span></tt>
environment variable and should be used rather than setting the environment
variable in the shell (to work around bugs in some versions of Python).</li>
<li><tt class="docutils literal"><span class="pre">--sdk</span> <span class="pre">&lt;SDK&gt;</span></tt> specifies the SDK to use.</li>
</ul>
<p>PyQt4 provides the <a class="reference internal" href="#cmdoption-configure.py--use-arch"><em class="xref std std-option">--use-arch</em></a> option that
specifies which architecture certain PyQt4 tools (actually only
<strong class="program">pyuic4</strong> at the moment) will use when running Python.  For example, if
your Qt installation is 32 bits, and your Python installation is 32 bits and
64 bits then you will need to specify <tt class="docutils literal"><span class="pre">--use-arch</span> <span class="pre">i386</span></tt> to ensure that
<strong class="program">pyuic4</strong> runs the 32 bit version of Python.</p>
</div>
</div>
<div class="section" id="building-pyqt4">
<h2>Building PyQt4<a class="headerlink" href="#building-pyqt4" title="Permalink to this headline">¶</a></h2>
<p>The next step is to build PyQt4 by running your platform&#8217;s <strong class="program">make</strong>
command.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">make</span>
</pre></div>
</div>
<p>The final step is to install PyQt4 by running the following command:</p>
<div class="highlight-python"><div class="highlight"><pre>make install
</pre></div>
</div>
<p>(Depending on your system you may require root or administrator privileges.)</p>
<p>This will install the various PyQt4 components.</p>
</div>
<div class="section" id="configuring-with-configuration-files">
<span id="ref-configuration-files"></span><h2>Configuring with Configuration Files<a class="headerlink" href="#configuring-with-configuration-files" title="Permalink to this headline">¶</a></h2>
<p>The <strong class="program">configure.py</strong> script normally introspects the Python installation
of the interpreter running it in order to determine the names of the various
files and directories it needs.  This is fine for a native build of PyQt4 but
isn&#8217;t appropriate when cross-compiling.  In this case it is possible to supply
a configuration file, specified using the <em class="xref std std-option">--configuration</em> option,
which contains definitions of all the required values.</p>
<p>A configuration file is made up of a number of named sections each of which
contains a number of configuration items.  The format of a configuration file
is as follows:</p>
<ul class="simple">
<li>a section name is a single line with the name enclosed between <tt class="docutils literal"><span class="pre">[</span></tt> and
<tt class="docutils literal"><span class="pre">]</span></tt></li>
<li>a configuration item is a single line containing a name/value pair separated
by <tt class="docutils literal"><span class="pre">=</span></tt></li>
<li>values may be extended to lines immediately following if they are indented by
at least one space</li>
<li>a value may include another value by embedding the name of that value
enclosed between <tt class="docutils literal"><span class="pre">%(</span></tt> and <tt class="docutils literal"><span class="pre">)</span></tt></li>
<li>comments begin with <tt class="docutils literal"><span class="pre">#</span></tt> and continue to the end of the line</li>
<li>blank lines are ignored.</li>
</ul>
<p>Those configuration items that appear before the first section name are
automatically added to all sections.</p>
<p>A configuration file defines a section for each version of Qt that requires a
different configuration.  <strong class="program">configure.py</strong> will choose the most
appropriate section according to the version of Qt you are actually using.  For
example, if a configuration file contains sections for Qt v5.3 and Qt v5.1 and
you are using Qt v5.2.1 then the section for Qt v5.1 will be chosen.</p>
<p><strong class="program">configure.py</strong> provides the following preset values for a
configuration:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">py_major</span></tt></dt>
<dd>is the major version number of the target Python installation.</dd>
<dt><tt class="docutils literal"><span class="pre">py_minor</span></tt></dt>
<dd>is the minor version number of the target Python installation.</dd>
<dt><tt class="docutils literal"><span class="pre">sysroot</span></tt></dt>
<dd>is the name of the system root directory.  This is specified with the
<em class="xref std std-option">--sysroot</em> option.</dd>
</dl>
<p>The following is an example configuration file:</p>
<div class="highlight-python"><div class="highlight"><pre># The target Python installation.
py_platform = linux
py_inc_dir = %(sysroot)/usr/include/python%(py_major).%(py_minor)
py_pylib_dir = %(sysroot)/usr/lib/python%(py_major).%(py_minor)/config
py_pylib_lib = python%(py_major).%(py_minor)mu

# The target PyQt installation.
pyqt_module_dir = %(sysroot)/usr/lib/python%(py_major)/dist-packages
pyqt_bin_dir = %(sysroot)/usr/bin
pyqt_sip_dir = %(sysroot)/usr/share/sip/PyQt4
pyuic_interpreter = /usr/bin/python%(py_major).%(py_minor)
pyqt_disabled_features = PyQt_Desktop_OpenGL PyQt_qreal_double

# Qt configuration common to all versions.
qt_shared = True

[Qt 5.1]
pyqt_modules = QtCore QtDBus QtDesigner QtGui QtHelp QtMultimedia
    QtMultimediaWidgets QtNetwork QtOpenGL QtPrintSupport QtQml QtQuick
    QtSensors QtSerialPort QtSql QtSvg QtTest QtWebKit QtWebKitWidgets
    QtWidgets QtXmlPatterns _QOpenGLFunctions_ES2
</pre></div>
</div>
<p>This example contains a section for Qt v5.1.  We have defined a number of
values before the start of the section as they are not specific to any
particular version of Qt.  Note that if you use this configuration with a
version of Qt earlier than v5.1 then you will get an error.</p>
<p>The following values can be specified in the configuration file:</p>
<dl class="docutils">
<dt><tt class="docutils literal"><span class="pre">qt_shared</span></tt></dt>
<dd>is set if Qt has been built as shared libraries.  The default value is
<tt class="docutils literal"><span class="pre">False</span></tt>.</dd>
<dt><tt class="docutils literal"><span class="pre">py_platform</span></tt></dt>
<dd>is the target Python platform.</dd>
<dt><tt class="docutils literal"><span class="pre">py_inc_dir</span></tt></dt>
<dd>is the target Python include directory, i.e. the directory containing the
<tt class="docutils literal"><span class="pre">Python.h</span></tt> file.</dd>
<dt><tt class="docutils literal"><span class="pre">py_pylib_dir</span></tt></dt>
<dd>is the target Python library directory.</dd>
<dt><tt class="docutils literal"><span class="pre">py_pylib_lib</span></tt></dt>
<dd>is the target Python interpreter library.  It should not include any
platform-specific prefix or suffix.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_disabled_features</span></tt></dt>
<dd>is the space separated list of features (as defined by SIP&#8217;s <tt class="docutils literal"><span class="pre">%Feature</span></tt>
directive) that should be disabled.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_module_dir</span></tt></dt>
<dd>is the target directory where the PyQt4 modules will be installed.  It can
be overridden by the <a class="reference internal" href="#cmdoption-configure.py--destdir"><em class="xref std std-option">--destdir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_modules</span></tt></dt>
<dd>is the space separated list of PyQt4 modules that will be built.  It can be
overridden by the <a class="reference internal" href="#cmdoption-configure.py--enable"><em class="xref std std-option">--enable</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_bin_dir</span></tt></dt>
<dd>is the name of the target directory where the PyQt4 related executables
will be installed.  It can be overridden by the <a class="reference internal" href="#cmdoption-configure.py--bindir"><em class="xref std std-option">--bindir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyqt_sip_dir</span></tt></dt>
<dd>is the name of the target directory where the PyQt4 <tt class="docutils literal"><span class="pre">.sip</span></tt> files will be
installed.  It can be overridden by the <a class="reference internal" href="#cmdoption-configure.py--sipdir"><em class="xref std std-option">--sipdir</em></a> option.</dd>
<dt><tt class="docutils literal"><span class="pre">pyuic_interpreter</span></tt></dt>
<dd>is the name of the Python interpreter (as it would be called from the
target system) that will be used to run <strong class="program">pyuic4</strong>.  It can be
overridden by the <em class="xref std std-option">--pyuic4-interpreter</em> option.</dd>
</dl>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="index.html">
              <img class="logo" src="_static/logo.png" alt="Logo"/>
            </a></p>
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Installing PyQt4</a><ul>
<li><a class="reference internal" href="#downloading-sip">Downloading SIP</a></li>
<li><a class="reference internal" href="#downloading-pyqt4">Downloading PyQt4</a></li>
<li><a class="reference internal" href="#configuring-pyqt4">Configuring PyQt4</a><ul>
<li><a class="reference internal" href="#using-configure-ng-py">Using <strong class="program">configure-ng.py</strong></a></li>
<li><a class="reference internal" href="#using-configure-py">Using <strong class="program">configure.py</strong></a></li>
<li><a class="reference internal" href="#configuring-sip-and-pyqt4-for-macos">Configuring SIP and PyQt4 for MacOS</a></li>
</ul>
</li>
<li><a class="reference internal" href="#building-pyqt4">Building PyQt4</a></li>
<li><a class="reference internal" href="#configuring-with-configuration-files">Configuring with Configuration Files</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="incompatibilities.html"
                        title="previous chapter">Potential Incompatibilities with Earlier Versions</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="python_v3.html"
                        title="next chapter">PyQt4 and Python v3</a></p>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="python_v3.html" title="PyQt4 and Python v3"
             >next</a> |</li>
        <li class="right" >
          <a href="incompatibilities.html" title="Potential Incompatibilities with Earlier Versions"
             >previous</a> |</li>
        <li><a href="index.html">PyQt 4.11.2 Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2014 Riverbank Computing Limited.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
    </div>
  </body>
</html>