What I did now to develop a GTK+
Application is to download and install Anaconda3
from here and then create a new virtual environment using:
conda create --name xld-attribute-value-adder python=3.4 pip setuptools pygobject
(I added pip
and setuptools
because virtualenv
used to add them when creating a virtual environment. I know I can use pip
for installing packages, but setuptools
's name implies it can be used or is used for something similar.)
Then Anaconda
tells me, that it cannot find PyGObject
and that I can search for it using binstar
(great, another tool to keep in mind!) as follows:
binstar search -t conda pygobject
However, that results in multiple search results:
Name | Version | Package Types | Platforms
------------------------- | ------ | --------------- | ---------------
???/pygobject3 | 3.12.0 | conda | linux-64
: None
KristanArmstrong/pygobject | 3.14.0 | conda | win-64
: PyGObject is a Python extension module that gives clean and consistent access to the entire GNOME software platform through the use of GObject Introspection.
fallen/pygobject | 3.14.0 | conda | linux-64, linux-32
: PyGObject is a Python extension module that gives clean and consistent access to the entire GNOME software platform through the use of GObject Introspection.
jeanconn/pygobject | | conda | linux-64
: None
pkgw/pygobject3 | 3.12.0 | conda | linux-64
: None
ska/pygobject | 2.20.0 | conda | linux-64
: Pipeline running tools
vgauthier/pygobject | 3.10.0 | conda | osx-64
: Python Bindings for GLib/GObject/GIO/GTK+
So how to know which one of those I need to install? I want the most up to date and stable one of course ... Some of them don't qualify, because they're not for my linux-64
system. I want to do a search, which only shows the ones available for my system, so I found some posts telling me, that this kind of search is possible on the Anaconda website itself entering the following in the search input field:
access:public platform:linux-64 pygobject
Now I see only 4 results and still don't know which one is most up to date, or which one I should use. the Anaconda website doesn't tell me when these repositories have been updated either. So I assume the one with the highest version number should be it. In fact I found a website, which states, that version PyGObject 3.14
is of 22 Sep 2014
or at least the post on that website is from that date.
I created the virtual environment without the pygobject argument:
conda create --name xld-attribute-value-adder python=3.4 pip setuptools
Then activated it:
source activate xld-attribute-value-adder
and then installed PyGObject
using:
conda install -c https://conda.anaconda.org/fallen pygobject
After that I changed the Project Interpreter
of this Project in my IDE PyCharm (yes I am using PyCharm for this project at the moment) to the Python 3.4
binary file of my newly created virtual environment:
(Project Directory)/bin/python3.4
Then I open a python file, which contains the line:
from gi.repository import Gtk
PyCharm does not find Gtk yet or has some other issue, so I needed to click the red underlined Gtk
and Alt+Enter
on it and choose to create binary stubs for it.
After all that it finally worked : )