File: installation.html

package info (click to toggle)
python-qt4 4.12.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 40,300 kB
  • ctags: 6,185
  • sloc: python: 125,988; cpp: 13,291; xml: 292; makefile: 246; php: 27; sh: 2
file content (923 lines) | stat: -rw-r--r-- 69,876 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
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923

<!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 &#8212; PyQt 4.12.1 Reference Guide</title>
    
    <link rel="stylesheet" href="_static/classic.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.12.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </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="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.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" role="navigation" aria-label="related navigation">
      <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 class="nav-item nav-item-0"><a href="index.html">PyQt 4.12.1 Reference Guide</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <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 <code class="docutils literal"><span class="pre">.tar.gz</span></code> or a <code class="docutils literal"><span class="pre">.zip</span></code> file
depending on your platform) you should then check for any <code class="file docutils literal"><span class="pre">README</span></code> 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 <code class="file docutils literal"><span class="pre">sip</span></code> directory, or to the directory specified by the
<a class="reference internal" href="#cmdoption-configure-ng-py-license-dir"><code class="xref std std-option docutils literal"><span class="pre">--license-dir</span></code></a> option of
<strong class="program">configure-ng.py</strong>.</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 <code class="xref py py-mod docutils literal"><span class="pre">sip.sipconfig</span></code> 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’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’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-default"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">configure</span><span class="o">-</span><span class="n">ng</span><span class="o">.</span><span class="n">py</span>
</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-default"><div class="highlight"><pre><span></span><span class="n">c</span><span class="p">:</span>\<span class="n">python34</span>\<span class="n">python</span> <span class="n">configure</span><span class="o">-</span><span class="n">ng</span><span class="o">.</span><span class="n">py</span>
</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">
<code class="descname">--assume-shared</code><code class="descclassname"></code><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">
<code class="descname">--bindir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-b</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-concatenate">
<code class="descname">--concatenate</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-c</code><code class="descclassname"></code><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"><code class="xref std std-option docutils literal"><span class="pre">--concatenate-split</span></code></a> option.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-concatenate-split">
<code class="descname">--concatenate-split</code><code class="descclassname"> &lt;N&gt;</code><code class="descclassname">, </code><code class="descname">-j</code><code class="descclassname"> &lt;N&gt;</code><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"><code class="xref std std-option docutils literal"><span class="pre">--concatenate</span></code></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">
<code class="descname">--configuration</code><code class="descclassname"> &lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-configuration" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">&lt;FILE&gt;</span></code> 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"><span class="std std-ref">Configuring with Configuration Files</span></a>.</p>
</dd></dl>

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

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-debug">
<code class="descname">--debug</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-u</code><code class="descclassname"></code><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">
<code class="descname">--designer-plugindir</code><code class="descclassname"> &lt;DIR&gt;</code><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
<code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-destdir">
<code class="descname">--destdir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-d</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.  The
default is the Python installation’s <code class="file docutils literal"><span class="pre">site-packages</span></code> directory.  If
you use this option then the <span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></code> environment variable must
include <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-enable">
<code class="descname">--enable</code><code class="descclassname"> &lt;MODULE&gt;</code><code class="descclassname">, </code><code class="descname">-e</code><code class="descclassname"> &lt;MODULE&gt;</code><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">
<code class="descname">--help</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-h</code><code class="descclassname"></code><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-license-dir">
<code class="descname">--license-dir</code><code class="descclassname"> &lt;DIR&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-license-dir" title="Permalink to this definition">¶</a></dt>
<dd><p>The license files needed by the commercial version of PyQt4 can be found in
the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-no-deprecated">
<code class="descname">--no-deprecated</code><code class="descclassname"></code><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">
<code class="descname">--no-designer-plugin</code><code class="descclassname"></code><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">
<code class="descname">--no-docstrings</code><code class="descclassname"></code><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-python-dbus">
<code class="descname">--no-python-dbus</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-ng-py-no-python-dbus" title="Permalink to this definition">¶</a></dt>
<dd><p>The Qt support for the standard Python DBus bindings is disabled.</p>
</dd></dl>

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

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-no-stubs">
<code class="descname">--no-stubs</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-ng-py-no-stubs" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.12.</span></p>
</div>
<p>The PEP 484 type hint stub files for the PyQt4 modules will not be
installed.  This option is ignored (and the stub files are not installed)
for versions of Python earlier than v3.5.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-no-tools">
<code class="descname">--no-tools</code><code class="descclassname"></code><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 <code class="docutils literal"><span class="pre">pyuic4</span></code>, <code class="docutils literal"><span class="pre">pyrcc4</span></code> and <code class="docutils literal"><span class="pre">pylupdate4</span></code> tools will not be built.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-no-timestamp">
<code class="descname">--no-timestamp</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-T</code><code class="descclassname"></code><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">
<code class="descname">--plugin</code><code class="descclassname"> &lt;PLUGIN&gt;</code><code class="descclassname">, </code><code class="descname">-t</code><code class="descclassname"> &lt;PLUGIN&gt;</code><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
<code class="docutils literal"><span class="pre">&lt;PLUGIN&gt;</span></code> 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">
<code class="descname">--protected-is-public</code><code class="descclassname"></code><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++ <code class="docutils literal"><span class="pre">protected</span></code> keyword as <code class="docutils literal"><span class="pre">public</span></code> 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">
<code class="descname">--protected-not-public</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-ng-py-protected-not-public" title="Permalink to this definition">¶</a></dt>
<dd><p>The default redefinition of <code class="docutils literal"><span class="pre">protected</span></code> to <code class="docutils literal"><span class="pre">public</span></code> during compilation
on Linux and MacOS/X is disabled.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-pyuic4-interpreter">
<code class="descname">--pyuic4-interpreter</code><code class="descclassname"> &lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-pyuic4-interpreter" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">&lt;FILE&gt;</span></code> 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">
<code class="descname">--qmake</code><code class="descclassname"> &lt;FILE&gt;</code><code class="descclassname">, </code><code class="descname">-q</code><code class="descclassname"> &lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-qmake" title="Permalink to this definition">¶</a></dt>
<dd><p>Qt’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><code class="xref std std-envvar docutils literal"><span class="pre">PATH</span></code>.
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><code class="xref std std-envvar docutils literal"><span class="pre">PATH</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-qsci-api">
<code class="descname">--qsci-api</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-a</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-ng-py-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="file docutils literal"><span class="pre">PyQt4.api</span></code> 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"><code class="xref std std-option docutils literal"><span class="pre">--qsci-api-destdir</span></code></a> option is specified.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-qsci-api-destdir">
<code class="descname">--qsci-api-destdir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-n</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="file docutils literal"><span class="pre">python</span></code>
subdirectory of the <code class="file docutils literal"><span class="pre">api</span></code> subdirectory of the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-sip">
<code class="descname">--sip</code><code class="descclassname"> &lt;FILE&gt;</code><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’s C++ source code.
Normally <strong class="program">sip</strong> is found on your <span class="target" id="index-3"></span><code class="xref std std-envvar docutils literal"><span class="pre">PATH</span></code>.  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">
<code class="descname">--sip-incdir</code><code class="descclassname"> &lt;DIR&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-sip-incdir" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="docutils literal"><span class="pre">sip.h</span></code> header file can be found in the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

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

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-spec">
<code class="descname">--spec</code><code class="descclassname"> &lt;SPEC&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-spec" title="Permalink to this definition">¶</a></dt>
<dd><p>The argument <code class="docutils literal"><span class="pre">-spec</span> <span class="pre">SPEC</span></code> 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 <code class="docutils literal"><span class="pre">&lt;SPEC&gt;</span></code>.)  On MacOS
<strong class="program">configure-ng.py</strong> will try and avoid <code class="docutils literal"><span class="pre">macx-xcode</span></code> if possible.)</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-static">
<code class="descname">--static</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-k</code><code class="descclassname"></code><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-stubdir">
<code class="descname">--stubdir</code><code class="descclassname"> &lt;DIR&gt;</code><a class="headerlink" href="#cmdoption-configure-ng-py-stubdir" title="Permalink to this definition">¶</a></dt>
<dd><div class="versionadded">
<p><span class="versionmodified">New in version 4.12.</span></p>
</div>
<p>The PEP 484 type hint stub files for the PyQt4 modules will be installed in
the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.  By default they will be stored in the same
directory as the corresponding extension modules.  This option is ignored
(and the stub files are not installed) for versions of Python earlier than
v3.5.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-sysroot">
<code class="descname">--sysroot</code><code class="descclassname"> &lt;DIR&gt;</code><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><code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code> is the name of an optional directory that replaces <code class="docutils literal"><span class="pre">sys.prefix</span></code>
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"><span class="std std-ref">Configuring with Configuration Files</span></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-target-py-version">
<code class="descname">--target-py-version</code><code class="descclassname"> &lt;VERSION&gt;</code><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><code class="docutils literal"><span class="pre">&lt;VERSION&gt;</span></code> is the major and minor version (e.g. <code class="docutils literal"><span class="pre">3.4</span></code>) 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"><span class="std std-ref">Configuring with Configuration Files</span></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-trace">
<code class="descname">--trace</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-r</code><code class="descclassname"></code><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’s <code class="xref py py-func docutils literal"><span class="pre">sip.settracemask()</span></code> function.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-ng-py-verbose">
<code class="descname">--verbose</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-w</code><code class="descclassname"></code><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">
<code class="descname">--version</code><code class="descclassname"></code><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
<code class="docutils literal"><span class="pre">name=value</span></code> or <code class="docutils literal"><span class="pre">name+=value</span></code>.  Such arguments are added to any
<strong class="program">qmake</strong> <code class="docutils literal"><span class="pre">.pro</span></code> 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-default"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">configure</span><span class="o">.</span><span class="n">py</span>
</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-default"><div class="highlight"><pre><span></span><span class="n">c</span><span class="p">:</span>\<span class="n">python34</span>\<span class="n">python</span> <span class="n">configure</span><span class="o">.</span><span class="n">py</span>
</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">
<code class="descname">--assume-shared</code><code class="descclassname"></code><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">
<code class="descname">--bindir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-b</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-concatenate">
<code class="descname">--concatenate</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-c</code><code class="descclassname"></code><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"><code class="xref std std-option docutils literal"><span class="pre">--concatenate-split</span></code></a> option.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-concatenate-split">
<code class="descname">--concatenate-split</code><code class="descclassname"> &lt;N&gt;</code><code class="descclassname">, </code><code class="descname">-j</code><code class="descclassname"> &lt;N&gt;</code><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"><code class="xref std std-option docutils literal"><span class="pre">--concatenate</span></code></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">
<code class="descname">--confirm-license</code><code class="descclassname"></code><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">
<code class="descname">--consolidate</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-g</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-py-consolidate" title="Permalink to this definition">¶</a></dt>
<dd><p>Normally each PyQt4 module (except for the <code class="xref py py-mod docutils literal"><span class="pre">Qt</span></code> module) is
linked against the corresponding Qt library.  This option creates a module
called <code class="xref py py-mod docutils literal"><span class="pre">_qt</span></code> 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">
<code class="descname">--dbus</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-s</code><code class="descclassname"> &lt;DIR&gt;</code><a class="headerlink" href="#cmdoption-configure-py-dbus" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="file docutils literal"><span class="pre">dbus-python.h</span></code> header file of the dbus-python package can be
found in the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;/dbus</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-debug">
<code class="descname">--debug</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-u</code><code class="descclassname"></code><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">
<code class="descname">--destdir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-d</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.  The
default is the Python installation’s <code class="file docutils literal"><span class="pre">site-packages</span></code> directory.  If
you use this option then the <span class="target" id="index-4"></span><code class="xref std std-envvar docutils literal"><span class="pre">PYTHONPATH</span></code> environment variable must
include <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-enable">
<code class="descname">--enable</code><code class="descclassname"> &lt;MODULE&gt;</code><code class="descclassname">, </code><code class="descname">-e</code><code class="descclassname"> &lt;MODULE&gt;</code><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">
<code class="descname">--help</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-h</code><code class="descclassname"></code><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">
<code class="descname">--no-deprecated</code><code class="descclassname"></code><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">
<code class="descname">--no-designer-plugin</code><code class="descclassname"></code><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">
<code class="descname">--no-docstrings</code><code class="descclassname"></code><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">
<code class="descname">--no-qsci-api</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-py-no-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="file docutils literal"><span class="pre">PyQt4.api</span></code> 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">
<code class="descname">--no-sip-files</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-py-no-sip-files" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="docutils literal"><span class="pre">.sip</span></code> files for the PyQt4 modules will not be installed.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-no-timestamp">
<code class="descname">--no-timestamp</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-T</code><code class="descclassname"></code><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">
<code class="descname">--plugin</code><code class="descclassname"> &lt;PLUGIN&gt;</code><code class="descclassname">, </code><code class="descname">-t</code><code class="descclassname"> &lt;PLUGIN&gt;</code><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
<code class="docutils literal"><span class="pre">&lt;PLUGIN&gt;</span></code> 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">
<code class="descname">--plugin-destdir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-p</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="file docutils literal"><span class="pre">designer</span></code> subdirectory of the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

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

<dl class="cmdoption">
<dt id="cmdoption-configure-py-qmake">
<code class="descname">--qmake</code><code class="descclassname"> &lt;FILE&gt;</code><code class="descclassname">, </code><code class="descname">-q</code><code class="descclassname"> &lt;FILE&gt;</code><a class="headerlink" href="#cmdoption-configure-py-qmake" title="Permalink to this definition">¶</a></dt>
<dd><p>Qt’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><code class="xref std std-envvar docutils literal"><span class="pre">PATH</span></code>.
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">
<code class="descname">--qsci-api</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-a</code><code class="descclassname"></code><a class="headerlink" href="#cmdoption-configure-py-qsci-api" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="file docutils literal"><span class="pre">PyQt4.api</span></code> 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"><code class="xref std std-option docutils literal"><span class="pre">--qsci-api-destdir</span></code></a> option is specified.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-qsci-api-destdir">
<code class="descname">--qsci-api-destdir</code><code class="descclassname"> &lt;DIR&gt;</code><code class="descclassname">, </code><code class="descname">-n</code><code class="descclassname"> &lt;DIR&gt;</code><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 <code class="file docutils literal"><span class="pre">python</span></code>
subdirectory of the <code class="file docutils literal"><span class="pre">api</span></code> subdirectory of the directory <code class="docutils literal"><span class="pre">&lt;DIR&gt;</span></code>.</p>
</dd></dl>

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

<dl class="cmdoption">
<dt id="cmdoption-configure-py-static">
<code class="descname">--static</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-k</code><code class="descclassname"></code><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">
<code class="descname">--trace</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-r</code><code class="descclassname"></code><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’s <code class="xref py py-func docutils literal"><span class="pre">sip.settracemask()</span></code> function.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-use-arch">
<code class="descname">--use-arch</code><code class="descclassname"> &lt;ARCH&gt;</code><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 <code class="docutils literal"><span class="pre">&lt;ARCH&gt;</span></code>.  See the section <a class="reference internal" href="#ref-macos"><span class="std std-ref">Configuring SIP and PyQt4 for MacOS</span></a>.</p>
</dd></dl>

<dl class="cmdoption">
<dt id="cmdoption-configure-py-verbose">
<code class="descname">--verbose</code><code class="descclassname"></code><code class="descclassname">, </code><code class="descname">-w</code><code class="descclassname"></code><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">
<code class="descname">--version</code><code class="descclassname"></code><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’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’s and PyQt4’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><code class="docutils literal"><span class="pre">--arch</span> <span class="pre">&lt;ARCH&gt;</span></code> specifies the target architecture and may be specified a
number of times.</li>
<li><code class="docutils literal"><span class="pre">--universal</span></code> is a shortcut for <code class="docutils literal"><span class="pre">--arch</span> <span class="pre">i386</span> <span class="pre">--arch</span> <span class="pre">ppc</span></code>.</li>
<li><code class="docutils literal"><span class="pre">--deployment-target</span> <span class="pre">&lt;VERSION&gt;</span></code> specifies the earliest version of MacOS you
want to support.  This sets the <span class="target" id="index-6"></span><code class="xref std std-envvar docutils literal"><span class="pre">MACOSX_DEPLOYMENT_TARGET</span></code>
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><code class="docutils literal"><span class="pre">--sdk</span> <span class="pre">&lt;SDK&gt;</span></code> specifies the SDK to use.</li>
</ul>
<p>PyQt4 provides the <a class="reference internal" href="#cmdoption-configure-py-use-arch"><code class="xref std std-option docutils literal"><span class="pre">--use-arch</span></code></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 <code class="docutils literal"><span class="pre">--use-arch</span> <span class="pre">i386</span></code> 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’s <strong class="program">make</strong>
command.  For example:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><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-default"><div class="highlight"><pre><span></span><span class="n">make</span> <span class="n">install</span>
</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-ng.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’t appropriate when cross-compiling.  In this case it is possible
to supply a configuration file, specified using the
<a class="reference internal" href="#cmdoption-configure-ng-py-configuration"><code class="xref std std-option docutils literal"><span class="pre">--configuration</span></code></a> 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 <code class="docutils literal"><span class="pre">[</span></code> and
<code class="docutils literal"><span class="pre">]</span></code></li>
<li>a configuration item is a single line containing a name/value pair separated
by <code class="docutils literal"><span class="pre">=</span></code></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 <code class="docutils literal"><span class="pre">%(</span></code> and <code class="docutils literal"><span class="pre">)</span></code></li>
<li>comments begin with <code class="docutils literal"><span class="pre">#</span></code> 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-ng.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-ng.py</strong> provides the following preset values for a
configuration:</p>
<dl class="docutils">
<dt><code class="docutils literal"><span class="pre">py_major</span></code></dt>
<dd>is the major version number of the target Python installation.</dd>
<dt><code class="docutils literal"><span class="pre">py_minor</span></code></dt>
<dd>is the minor version number of the target Python installation.</dd>
<dt><code class="docutils literal"><span class="pre">sysroot</span></code></dt>
<dd>is the name of the system root directory.  This is specified with the
<a class="reference internal" href="#cmdoption-configure-ng-py-sysroot"><code class="xref std std-option docutils literal"><span class="pre">--sysroot</span></code></a> option.</dd>
</dl>
<p>The following is an example configuration file:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="c1"># The target Python installation.</span>
<span class="n">py_platform</span> <span class="o">=</span> <span class="n">linux</span>
<span class="n">py_inc_dir</span> <span class="o">=</span> <span class="o">%</span><span class="p">(</span><span class="n">sysroot</span><span class="p">)</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">include</span><span class="o">/</span><span class="n">python</span><span class="o">%</span><span class="p">(</span><span class="n">py_major</span><span class="p">)</span><span class="o">.%</span><span class="p">(</span><span class="n">py_minor</span><span class="p">)</span>
<span class="n">py_pylib_dir</span> <span class="o">=</span> <span class="o">%</span><span class="p">(</span><span class="n">sysroot</span><span class="p">)</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">python</span><span class="o">%</span><span class="p">(</span><span class="n">py_major</span><span class="p">)</span><span class="o">.%</span><span class="p">(</span><span class="n">py_minor</span><span class="p">)</span><span class="o">/</span><span class="n">config</span>
<span class="n">py_pylib_lib</span> <span class="o">=</span> <span class="n">python</span><span class="o">%</span><span class="p">(</span><span class="n">py_major</span><span class="p">)</span><span class="o">.%</span><span class="p">(</span><span class="n">py_minor</span><span class="p">)</span><span class="n">mu</span>

<span class="c1"># The target PyQt installation.</span>
<span class="n">pyqt_module_dir</span> <span class="o">=</span> <span class="o">%</span><span class="p">(</span><span class="n">sysroot</span><span class="p">)</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">lib</span><span class="o">/</span><span class="n">python</span><span class="o">%</span><span class="p">(</span><span class="n">py_major</span><span class="p">)</span><span class="o">/</span><span class="n">dist</span><span class="o">-</span><span class="n">packages</span>
<span class="n">pyqt_bin_dir</span> <span class="o">=</span> <span class="o">%</span><span class="p">(</span><span class="n">sysroot</span><span class="p">)</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="nb">bin</span>
<span class="n">pyqt_sip_dir</span> <span class="o">=</span> <span class="o">%</span><span class="p">(</span><span class="n">sysroot</span><span class="p">)</span><span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="n">share</span><span class="o">/</span><span class="n">sip</span><span class="o">/</span><span class="n">PyQt4</span>
<span class="n">pyuic_interpreter</span> <span class="o">=</span> <span class="o">/</span><span class="n">usr</span><span class="o">/</span><span class="nb">bin</span><span class="o">/</span><span class="n">python</span><span class="o">%</span><span class="p">(</span><span class="n">py_major</span><span class="p">)</span><span class="o">.%</span><span class="p">(</span><span class="n">py_minor</span><span class="p">)</span>
<span class="n">pyqt_disabled_features</span> <span class="o">=</span> <span class="n">PyQt_Desktop_OpenGL</span> <span class="n">PyQt_qreal_double</span>

<span class="c1"># Qt configuration common to all versions.</span>
<span class="n">qt_shared</span> <span class="o">=</span> <span class="kc">True</span>

<span class="p">[</span><span class="n">Qt</span> <span class="mf">5.1</span><span class="p">]</span>
<span class="n">pyqt_modules</span> <span class="o">=</span> <span class="n">QtCore</span> <span class="n">QtDBus</span> <span class="n">QtDesigner</span> <span class="n">QtGui</span> <span class="n">QtHelp</span> <span class="n">QtMultimedia</span>
    <span class="n">QtMultimediaWidgets</span> <span class="n">QtNetwork</span> <span class="n">QtOpenGL</span> <span class="n">QtPrintSupport</span> <span class="n">QtQml</span> <span class="n">QtQuick</span>
    <span class="n">QtSensors</span> <span class="n">QtSerialPort</span> <span class="n">QtSql</span> <span class="n">QtSvg</span> <span class="n">QtTest</span> <span class="n">QtWebKit</span> <span class="n">QtWebKitWidgets</span>
    <span class="n">QtWidgets</span> <span class="n">QtXmlPatterns</span> <span class="n">_QOpenGLFunctions_ES2</span>
</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><code class="docutils literal"><span class="pre">qt_shared</span></code></dt>
<dd>is set if Qt has been built as shared libraries.  The default value is
<code class="docutils literal"><span class="pre">False</span></code>.</dd>
<dt><code class="docutils literal"><span class="pre">py_platform</span></code></dt>
<dd>is the target Python platform.</dd>
<dt><code class="docutils literal"><span class="pre">py_inc_dir</span></code></dt>
<dd>is the target Python include directory, i.e. the directory containing the
<code class="docutils literal"><span class="pre">Python.h</span></code> file.</dd>
<dt><code class="docutils literal"><span class="pre">py_pylib_dir</span></code></dt>
<dd>is the target Python library directory.</dd>
<dt><code class="docutils literal"><span class="pre">py_pylib_lib</span></code></dt>
<dd>is the target Python interpreter library.  It should not include any
platform-specific prefix or suffix.</dd>
<dt><code class="docutils literal"><span class="pre">pyqt_disabled_features</span></code></dt>
<dd>is the space separated list of features (as defined by SIP’s <code class="docutils literal"><span class="pre">%Feature</span></code>
directive) that should be disabled.</dd>
<dt><code class="docutils literal"><span class="pre">pyqt_module_dir</span></code></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-ng-py-destdir"><code class="xref std std-option docutils literal"><span class="pre">--destdir</span></code></a>
option.</dd>
<dt><code class="docutils literal"><span class="pre">pyqt_modules</span></code></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-ng-py-enable"><code class="xref std std-option docutils literal"><span class="pre">--enable</span></code></a> option.</dd>
<dt><code class="docutils literal"><span class="pre">pyqt_bin_dir</span></code></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-ng-py-bindir"><code class="xref std std-option docutils literal"><span class="pre">--bindir</span></code></a> option.</dd>
<dt><code class="docutils literal"><span class="pre">pyqt_sip_dir</span></code></dt>
<dd>is the name of the target directory where the PyQt4 <code class="docutils literal"><span class="pre">.sip</span></code> files will be
installed.  It can be overridden by the
<a class="reference internal" href="#cmdoption-configure-ng-py-sipdir"><code class="xref std std-option docutils literal"><span class="pre">--sipdir</span></code></a> option.</dd>
<dt><code class="docutils literal"><span class="pre">pyuic_interpreter</span></code></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
<a class="reference internal" href="#cmdoption-configure-ng-py-pyuic4-interpreter"><code class="xref std std-option docutils literal"><span class="pre">--pyuic4-interpreter</span></code></a>
option.</dd>
</dl>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <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" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <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 class="nav-item nav-item-0"><a href="index.html">PyQt 4.12.1 Reference Guide</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2016 Riverbank Computing Limited.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.2.
    </div>
  </body>
</html>