1

I have recently stated a arduino project for my engineering class. I mange to get python to talk to arduino via serial communication. Now I can send data to the board, I want to be able to set up a graphical user interface GUI with GTK, so that the user and push a button in the GUI and a LED turns on. However, I am trying to install the GTK liberty and I am running into a lot of problems.

Problem: I download GTK via pyip, when I run the set up file in the command line it says you have to install pyobject. So i went back to pyip and download the pyobject module and run the set up file. When I run the set up file I get this error message "ERROR: Could not find pkg-config: Please check your PATH environment variable." I downloaded the pyconfig from pyip ran it and the set up ran fine. But when i went to install pyobject I keep getting this error. Can someone direct tell me how to install GTK properly or how to fix my problem. PS I try setting my windows environment to the location of my pkg-config file.

Error from Installer

this is what i get when i start the exe

CMD error :Error from cmd

Help would be deeply appreciated

Thanks

Sean From Boxing Studio Games

SeanDp32
  • 199
  • 4
  • 17
  • This is a duplicate of [this](https://stackoverflow.com/questions/26323732/struggling-to-install-pygtk-with-pip) I think. – IronManMark20 May 06 '15 at 01:30
  • @IronManMark20: I'm not sure if it's a dup… but it's at least worth trying the explicit `PKG_CONFIG_PATH` mentioned in one of the answers there (which wasn't appropriate to that question, but might be to this one). – abarnert May 06 '15 at 01:32
  • Except that answer is completely wrong, so… never mind. – abarnert May 06 '15 at 01:34
  • First, `pyconfig` and `pkg-config` are not the same thing. You still need to install `pkg-config`. – abarnert May 06 '15 at 01:35
  • Hmm... your right, but the answer might be there... – IronManMark20 May 06 '15 at 01:36
  • Do you know a fast and easier way to install the library ? I tried the installers and it say it cannot find my python 2.7, but I have python 2.7 compiling on my machine fine. – SeanDp32 May 06 '15 at 01:38
  • Do you actually want Gtk+2 rather than Gtk+3? – abarnert May 06 '15 at 01:57
  • Also, make sure your Python, Gtk+, and PyGtk+ or Py-GObject are all for the same bitness; you can't use a 32-bit Python with a 64-bit Gtk+ or vice-versa. – abarnert May 06 '15 at 01:58

2 Answers2

1

I would suggest that you use the latest all-in-one installer for pyGTK. You can find it here.

It should automagically install all of the dependencies for pyGTK.

IronManMark20
  • 1,298
  • 12
  • 28
0

I believe that your problem is that you're trying to find non-Python prerequisites via pip.

You say "I download GTK via pyip", I don't know any package manager named pyip. If you mean pip, that only installs Python packages; it doesn't help get the DLLs and other files that are needed to build those Python packages. In particular, to install the Python bindings for Gtk+ and do anything useful with them, you have to have Gtk+ itself. You can get a nice installer package from the Gtk website.

Also, you have to be precise with names. If you're missing pkg-config, installing something called pyconfig isn't going to help; they have nothing to do with each other. Similarly, pip is the Python package installer; pyip is a library for dealing with raw IP packets; they have nothing to do with each other.

At any rate, the Gtk+ binaries should have all the prerequisites you need. Then pip should be able to install the Python bindings… assuming you have a compiler set up properly. But somehow, I have a feeling that you don't have one set up, and don't know how.

Fortunately, Christoph Gohlke's repo has prebuilt binary wheels for almost anything you could want in Python that's hard to build for Windows. Just download the .whl files you need from that package, and follow the instructions on the page to install them with pip.

abarnert
  • 354,177
  • 51
  • 601
  • 671
  • Sorry about that I was wrong I meant to say pip not pyip – SeanDp32 May 06 '15 at 01:58
  • @user2566626: I can guess what you mean, but Windows and Python can't. And if you keep making that kind of mistake, like installing `pyconfig` when they tell you that you need `pkg-config`, you're going to have a lot of trouble. – abarnert May 06 '15 at 01:59
  • thanks for letting me know that I might use pyQT instead. i just have to look up the documentation. – SeanDp32 May 06 '15 at 02:35
  • @user2566626: Did I even mention Qt? Anyway, yes, Qt and PyQt or PySide may be easier to install on Windows than Gtk+, but I'm not sure I'd made "easy to install on my development machine" the main criterion for choosing a GUI library. If that _is_ your main criterion, just use Tkinter, which comes built in with Python. – abarnert May 06 '15 at 02:39
  • yeah I am going to use tinker since it is built in Thanks for your help – SeanDp32 May 06 '15 at 03:10