Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6768845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:07:22+00:00 2026-05-26T15:07:22+00:00

I use this script to start qt designer with my custom widgets (in Python

  • 0

I use this script to start qt designer with my custom widgets (in Python 3) visible:

#!/usr/bin/env python3

import os, sys, subprocess

curDir = os.path.dirname(os.path.abspath(__file__))
params = list(sys.argv) # copy list
params[0] = 'designer' # "designer-qt4" on Linux

widgetsDir = os.path.join(curDir, 'wic', 'widgets')

# add search path for custom widgets and plugins for designer
os.putenv('PYQTDESIGNERPATH', widgetsDir)

subprocess.Popen(params)

But it looks like designer is using python 2.7 to use the widget plugins:

vic@ubuntu:~/wic$ python3 qt_designer.pyw 
vic@ubuntu:~/wic$   File "/home/vic/wic/wic/widgets/w_date_edit_plugin.py", line 63
    app.exec()
           ^
SyntaxError: invalid syntax

How to instruct designer to use Python 3, not Python 2?

I use Kubuntu 11.10, KDE 4.7.2, python3.2 and python2.7, PyQt v4.8.5 compiled for Python 3

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:07:22+00:00Added an answer on May 26, 2026 at 3:07 pm

    It looks like PyQt does not allow for side-by-side installation of the designer plugin that handles custom widgets (libpythonplugin.so). So there will normally be a single plugin linked against either python2, or python3, but not both.

    It would appear that Kubuntu currently installs the python2 version of the plugin (on my linux system, it’s the other way around). If you want a python3 version of the plugin, just compile a replacement from source.

    EDIT

    To compile a replacement, first ensure you have the sip packages installed. I am no expert on ubuntu, but I think you will need the python-sip-dev and python3-sip-dev packages (plus any dependencies, of course).

    Next, download the PyQt4 sources that match the version installed on your system. I was able to find some ubuntu pyqt source packages here.

    Now unpack the tarball, cd into the resulting source directory (looks like it should be PyQt-x11-gpl-4.8.5 for Kubuntu 11.10), and then configure the build using python3:

    $ cd ~/tmp
    $ tar -xf python-qt4_4.8.5.orig.tar.gz
    $ cd PyQt-x11-gpl-4.8.5
    $ /usr/bin/python3.2 configure.py -c -j 4
    

    If that completes without error, build it (but do not install it):

    $ make
    

    Using the above configuration options it takes about 5 mins to compile pyqt on my old i686-AMD64-X2-6000 system. Once complete, the libpythonplugin.so plugin should be in the PyQt-x11-gpl-4.8.5/designer directory.

    You can now backup and remove the existing plugin (on my system it’s in the /usr/lib/qt/plugins/designer directory), and copy over your new plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this simple Perl script: #! /usr/bin/perl -w use strict; use Data::Dumper; my
I am converting a linux script from http://www.perlmonks.org/index.pl?node_id=217166 specifically this: #!/usr/bin/perl -w use strict;
I use this script to equalize heights of elements: (function ($) { $.fn.autoheight =
I used to use this script for jquery email obfuscation: $(.replaceAt).replaceWith(@); $(.obfuscate).each(function () {
During development, I use this to load the latest jQuery: <script src=http://www.google.com/jsapi></script> <script type=text/javascript>
I have this .bat script which I use to maven package my application. Problem
I'm puzzled with this test script: #!perl use strict; use warnings; use encoding 'utf8';
I wanted to use groovy for a little ftp script and found this post
This is from a sql script. What tool can generate this? Thanks --USE [MY_TABLE]
This question is simple. What function would I use in a PHP script to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.