Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Using Python and QT... or PyQT?

  1. #1
    Join Date
    Dec 2009
    Location
    Humboldt County
    Beans
    45
    Distro
    Ubuntu 9.10 Karmic Koala

    Using Python and QT... or PyQT?

    I've been trying to get PyQT configured with no luck. If anyone is using Python 2.6 and QT4 and could help me get it configured I'd appreciate it.

    1. I have downloaded and installed Python 2.6 and it works.
    2. I have downloaded QT4 and QT Designer, and that works.
    3. I downloaded "PyQT" from riverbank software, and this is what DOESN'T work. It wants me to run a configure.py script which fails.
    4. It seems like I don't have the PyQT files in the right directory, or that perhaps PyQT needs to work with very, VERY specific versions of QT and Python. I dunno.

  2. #2
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Using Python and QT... or PyQT?

    Please, please tell me you aren't trying to set this up without using the package manager...

    Code:
    sudo aptitude install python-qt4 python-qt4-dev pyqt-tools
    should pull everything you need and set them up.
    LambdaGrok. | #ubuntu-programming on FreeNode

  3. #3
    Join Date
    Dec 2009
    Location
    Humboldt County
    Beans
    45
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Using Python and QT... or PyQT?

    I hope you don't mind the stupid question here but.....I have successfully downloaded all the various elements. I can't get them to "play" together.

    1, From the riverbank web site, they say to do this:
    "After unpacking the source package (either a .tar.gz or a .zip file depending on your platform) you should then check for any README files that relate to your platform.
    Next you need to configure SIP by executing the configure.py script. For example:
    python configure.py"

    Now, when I do that, I get an error from Python which says something like, "no such directory". And a few other error messages like that.

    That's what is confusing me - this "configuration" business.

  4. #4
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Using Python and QT... or PyQT?

    Quote Originally Posted by redwoodguy View Post
    I have successfully downloaded all the various elements.
    Is there a real reason as to why you are downloading them... from... "websites"?
    LambdaGrok. | #ubuntu-programming on FreeNode

  5. #5
    Join Date
    Dec 2009
    Location
    Humboldt County
    Beans
    45
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Using Python and QT... or PyQT?

    Yes, I was trying to do it without the package manager, because the package manager did not seem to find all the pieces. So, I then went to Riverbank software and downloaded the tar.gz files, moved them into the Python directory and then tried to run that configure.py script. Bad idea, I take it?

  6. #6
    Join Date
    Dec 2009
    Location
    Humboldt County
    Beans
    45
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Using Python and QT... or PyQT?

    Here's the longer story.
    I used package manager to download PyQT. I then used QT Designer to make a small form - resulting in a *.ui file. I tried to run the *.ui file then into Python and that's when it told me I didn't have the right bits - the bit which generates Python code from the *.ui file. I think it is called "pyuic" or something similar.

  7. #7
    Join Date
    Jun 2008
    Location
    California, USA
    Beans
    1,030
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Using Python and QT... or PyQT?

    Quote Originally Posted by redwoodguy View Post
    Here's the longer story.
    I used package manager to download PyQT. I then used QT Designer to make a small form - resulting in a *.ui file. I tried to run the *.ui file then into Python and that's when it told me I didn't have the right bits - the bit which generates Python code from the *.ui file. I think it is called "pyuic" or something similar.
    The pyuic executable comes separate from the regular PyQt package, it comes in another package (along with some other handy tools) which is pyqt4-dev-tools
    So, just install that and you're ready to go.

    Blog | I'm available for programming contributions. C & Python.
    Intel Core i7 920 | EVGA x58 SLI | NVidia GeForce 8600 GT | WD 500GB HDD | Corsair XMS3 3GB | Ubuntu 9.04

  8. #8
    Join Date
    Aug 2006
    Location
    60°27'48"N 24°48'18"E
    Beans
    3,458

    Re: Using Python and QT... or PyQT?

    Ok, now I'm starting to see where you're at (giving enough context is always advisable... ). I believe pyuic is in the pyqt-tools package, I spent some time looking for it too a while ago...

    EDIT: What above said; it's pyqt4-dev-tools for Qt4.

    Going out to the web and download and manually install stuff is always your last choice. You don't want to litter the system with self-installed, non-managed random versions of things...
    Last edited by CptPicard; December 26th, 2009 at 10:10 PM.
    LambdaGrok. | #ubuntu-programming on FreeNode

  9. #9
    Join Date
    Dec 2009
    Location
    Norway
    Beans
    24
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Using Python and QT... or PyQT?

    I believe the pyqt-tools package is for Qt3. For Qt4, you'll want pyqt4-dev-tools.
    Unless you have a specific reason for using Qt3, you shold stick to Qt4.

  10. #10
    Join Date
    Dec 2009
    Location
    Humboldt County
    Beans
    45
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Using Python and QT... or PyQT?

    OK. I think this is resolved.

    1. I installed pyqt4-dev-tools and I notice it said "0 files installed" by which I assumed I already had it.
    2. I tried running "pyuic" again. Suddenly, it dawned on me that this should be run from the bash terminal window, not the Python interpreter window. D'oh. I am never surprised by how ignorant I can be.
    3. Pyuic runs now, but I will have to now get my options and switches set right to actually accomplish getting code out of it.

    Thanks to all for your patience. I only installed my first Linux system last week, and only started with Python kind of yesterday. And, I am old and decrepit too. The last program I wrote was in COBOL in 1972 on an NCR 615 Mainframe with 32k core memory and a 5MB HD.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •