title: "No module named". Python error in gdb
body: <p>I'm working on a class project (don't worry, this question is not homework) and recently moved from department machines to my own machine.
  The project is to build a simple operating system. To make the task easier, we are provided with the ability to "attach" gdb to QEMU in which our program runs. Running this program without attaching gdb on my computer works fine, however it is when I start trying to use gdb that it does not run.
  The main thing to note (I think) is that it runs fine on the department computers (gdb 7.4.1-debian) but not on mine (7.6.1-ubuntu).</p>
  
  <p>The error I am getting pertaining to python is that gdb extensions are written in python but they do not seem to be found. I am also getting syntax error. A run of the program looks like this:</p>
  
  <pre><code>/usr/bin/qemu-system-i386
  GNU gdb (GDB) 7.6.1-ubuntu
  Copyright (C) 2013 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  and "show warranty" for details.
  This GDB was configured as "x86_64-linux-gnu".
  For bug reporting instructions, please see:
  &lt;http://www.gnu.org/software/gdb/bugs/&gt;...
  Reading symbols from /home/alfonso/course/cs167/weenix/kernel/weenix.dbg...done.
  </code></pre>
  
  <p>After which it hangs for a bit, then gives me this error:</p>
  
  <pre><code>inittmp.gdb:1: Error in sourced command file:
  localhost:1234: Connection timed out.
  Traceback (most recent call last):
    File "/home/alfonso/course/cs167/weenix/kernel/mm/memcheck.py", line 5, in &lt;module&gt;
      import weenix
  ImportError: No module named 'weenix'
    File "/home/alfonso/course/cs167/weenix/kernel/mm/page.py", line 15
      print "pagesize: {0}".format(weenix.kmem.pagesize())
                          ^
  SyntaxError: invalid syntax
    File "/home/alfonso/course/cs167/weenix/kernel/mm/slab.py", line 40
      print "{1:&lt;{0}} {3:&gt;{2}} {5:&gt;{4}} {7:&gt;{6}}".format(
                                                ^
  SyntaxError: invalid syntax
    File "/home/alfonso/course/cs167/weenix/kernel/proc/proc.py", line 17
      print weenix.proc.str_proc_tree()
                 ^
  SyntaxError: invalid syntax
  Traceback (most recent call last):
    File "/home/alfonso/course/cs167/weenix/kernel/util/debug.py", line 3, in &lt;module&gt;
      import weenix
  ImportError: No module named 'weenix'
  Traceback (most recent call last):
    File "/home/alfonso/course/cs167/weenix/kernel/util/list.py", line 3, in &lt;module&gt;
      import weenix
  ImportError: No module named 'weenix'
  Breakpoint 1 at 0xc0008f04: file util/debug.c, line 190.
  Breakpoint 2 at 0xc0007016: file main/kmain.c, line 298.
  Breakpoint 3 at 0xc0006cf3: file main/kmain.c, line 129.
  init.gdb:6: Error in sourced command file:
  The program is not being run.
  </code></pre>
  
  <p>Of course, the import errors and invalid syntaxes made me initially think about my PYTHONPATH and/or package settings, but that is something that works fine (tested it). The only thing I can think of is that I have some configuration problems that I am overlooking.</p>
  
  <p>If you would like me to, I can post the bash script, .gdb files and the rest, but since this works fine on department computers, I doubt this is the problem.</p>
  
  <p>Python versions: (department: "2.7.3", me: "2.7.5+")</p>
  
  <p>EDIT:
  After some searching, I have realized that the newest Linux Mint(petra) uses gdb that interprets python as python3. I am currently looking for a way to configure gdb, but as I have never done it before, I would appreciate if someone could direct me in doing so.</p>