title: ValueError: Namespace Gtk not available
body: <p>When following the instructions <a href="https://python-gtk-3-tutorial.readthedocs.io/en/latest/introduction.html" rel="noreferrer">2. Getting Started — Python GTK+ 3 Tutorial 3.4 documentation</a></p>
  
  <p>Tries </p>
  
  <pre><code>In [6]: import gi
     ...: gi.require_version('Gtk', '3.0')
     ...: from gi.repository import Gtk
  </code></pre>
  
  <p>it report errors:</p>
  
  <pre><code>~/anaconda3/lib/python3.7/site-packages/gi/__init__.py in require_version(namespace, version)
      128     available_versions = repository.enumerate_versions(namespace)
      129     if not available_versions:
  --&gt; 130         raise ValueError('Namespace %s not available' % namespace)
      131
      132     if version not in available_versions:
  
  ValueError: Namespace Gtk not available
  </code></pre>
  
  <p>Follow <a href="https://askubuntu.com/questions/101306/how-do-i-install-gtk-3-0">How do I Install GTK+ 3.0? - Ask Ubuntu</a> and intstalled Gtk to ubuntu </p>
  
  <pre><code>sudo apt-get install libgtk-3-dev
  </code></pre>
  
  <p>However, it still report the same errors.</p>
  
  <p>How could solve I the problem?</p>
  
  <p>Note: </p>
  
  <p>Tried the solution </p>
  
  <pre><code>me@host:~:
  $ sudo apt install python3-gi gobject-introspection gir1.2-gtk-3.0
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  gir1.2-gtk-3.0 is already the newest version (3.24.8-1ubuntu1).
  gobject-introspection is already the newest version (1.60.1-1).
  python3-gi is already the newest version (3.32.0-1).
  0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
  me@host:~:
  $ python
  Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
  [GCC 7.3.0] :: Anaconda, Inc. on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import gi
  &gt;&gt;&gt; gi.require_version('Gtk', '3.0')
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/home/me/anaconda3/lib/python3.7/site-packages/gi/__init__.py", line 130, in require_version
      raise ValueError('Namespace %s not available' % namespace)
  ValueError: Namespace Gtk not available
  </code></pre>
  
  <p>Install others</p>
  
  <pre><code>me@host:~:
  $ sudo apt install -y gir1.2-gtk-3.0
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  gir1.2-gtk-3.0 is already the newest version (3.24.8-1ubuntu1).
  0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
  me@host~:
  $ ipython
  Python 3.7.3 (default, Mar 27 2019, 22:11:17) 
  Type 'copyright', 'credits' or 'license' for more information
  IPython 7.4.0 -- An enhanced Interactive Python. Type '?' for help.
  
  In [1]:  import gi                                                                                                        
  
  In [2]: gi.require_version('Gtk', '3.0')                                                                                  
  ---------------------------------------------------------------------------
  ValueError                                Traceback (most recent call last)
  &lt;ipython-input-2-3fc173a88e42&gt; in &lt;module&gt;
  ----&gt; 1 gi.require_version('Gtk', '3.0')
  
  ~/anaconda3/lib/python3.7/site-packages/gi/__init__.py in require_version(namespace, version)
      128     available_versions = repository.enumerate_versions(namespace)
      129     if not available_versions:
  --&gt; 130         raise ValueError('Namespace %s not available' % namespace)
      131 
      132     if version not in available_versions:
  
  ValueError: Namespace Gtk not available
  </code></pre>
  
  <p>It did not work, </p>
  
  <p>My machine:</p>
  
  <pre><code>$ lsb_release -a
  No LSB modules are available.
  Distributor ID: Ubuntu
  Description:    Ubuntu 19.04
  Release:    19.04
  Codename:   disco
  </code></pre>
  
  <p>I encountered the problem when install dropbox to ubuntu </p>
  
  <pre><code>$ dropbox start
  Starting Dropbox...
  The Dropbox daemon is not installed!
  Run "dropbox start -i" to install the daemon
  </code></pre>
  
  <p>Run "dropbox start -i"</p>
  
  <pre><code>$ dropbox start -i
  Starting Dropbox...Traceback (most recent call last):
    File "/usr/bin/dropbox", line 1443, in start
      download()
    File "/usr/bin/dropbox", line 295, in download
      gi.require_version('Gdk', '3.0')
    File "/home/gaowei/anaconda3/lib/python3.7/site-packages/gi/__init__.py", line 130, in require_version
      raise ValueError('Namespace %s not available' % namespace)
  ValueError: Namespace Gdk not available
  </code></pre>