Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72385 > unrolled thread

ImportError: No module named _gdb

Started byMarcelo Sardelich <msardelich@gmail.com>
First post2014-06-01 15:43 -0700
Last post2014-06-03 08:11 +0200
Articles 4 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  ImportError: No module named _gdb Marcelo Sardelich <msardelich@gmail.com> - 2014-06-01 15:43 -0700
    Re: ImportError: No module named _gdb dieter <dieter@handshake.de> - 2014-06-02 08:07 +0200
      Re: ImportError: No module named _gdb Marcelo Sardelich <msardelich@gmail.com> - 2014-06-02 10:22 -0700
        Re: ImportError: No module named _gdb dieter <dieter@handshake.de> - 2014-06-03 08:11 +0200

#72385 — ImportError: No module named _gdb

FromMarcelo Sardelich <msardelich@gmail.com>
Date2014-06-01 15:43 -0700
SubjectImportError: No module named _gdb
Message-ID<431f3c0e-1cc3-43b2-91a0-34acf3b1da09@googlegroups.com>
So I'm trying to implement pretty printing information using gdb-python27 on Windows7

Hopefully, someone experienced the same issue.

GDB is working fine, but when I run gdb-python27 I got the following error (related to a python import):

C:\MinGW\bin>gdb-python27.exe
Traceback (most recent call last):
  File "<string>", line 70, in <module>
  File "<string>", line 67, in GdbSetPythonDirectory
  File "c:\mingw\share\gdb/python\gdb\__init__.py", line 19, in <module>
    import _gdb
ImportError: No module named _gdb
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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 "i686-pc-mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
warning: File "C:\MinGW\bin\.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
(gdb)

Does anybody have any clue about this issue?

Best, Marcelo.

PS: I posted same question to MinGW group, but maybe the issue is related to Python.

Below, config information:

OS Windows 7

C:\MinGW\bin>cat .gdbinit
python
import sys
sys.path.insert(0, 'c:/gdb-printers/python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end

C:\MinGW\include>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.8.1/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.8.1/configure --prefix=/mingw --host=mingw32 --build=mingw32 --without-pic --enable-shared --enable-static --with-gnu-ld --enable-lto --enable-libssp --disable-multilib --ena
ble-languages=c,c++,fortran,objc,obj-c++,ada --disable-sjlj-exceptions --with-dwarf2 --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --with-gmp=/usr/src/pkg/gm
p-5.1.2-1-mingw32-src/bld --with-mpc=/usr/src/pkg/mpc-1.0.1-1-mingw32-src/bld --with-mpfr= --with-system-zlib --with-gnu-as --enable-decimal-float=yes --enable-libgomp --enable-threads --with-libiconv
-prefix=/mingw32 --with-libintl-prefix=/mingw --disable-bootstrap LDFLAGS=-s CFLAGS=-D_USE_32BIT_TIME_T
Thread model: win32
gcc version 4.8.1 (GCC)

C:\MinGW\include>python
Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

w32api.h (version):

#define __W32API_VERSION 3.17
#define __W32API_MAJOR_VERSION 3
#define __W32API_MINOR_VERSION 17

_mingw.h (version):

#define __MINGW_VERSION             4.0
#define __MINGW_MAJOR_VERSION       4
#define __MINGW_MINOR_VERSION       0
#define __MINGW_PATCHLEVEL          0

/* The following four macros are deprecated and will be removed
 * in the release greater than 4.1.
 */
#define __MINGW32_VERSION           3.20
#define __MINGW32_MAJOR_VERSION     3
#define __MINGW32_MINOR_VERSION     20
#define __MINGW32_PATCHLEVEL        0

[toc] | [next] | [standalone]


#72394

Fromdieter <dieter@handshake.de>
Date2014-06-02 08:07 +0200
Message-ID<mailman.10537.1401689257.18130.python-list@python.org>
In reply to#72385
Marcelo Sardelich <msardelich@gmail.com> writes:
> So I'm trying to implement pretty printing information using gdb-python27 on Windows7
>
> Hopefully, someone experienced the same issue.
>
> GDB is working fine, but when I run gdb-python27 I got the following error (related to a python import):
>
> C:\MinGW\bin>gdb-python27.exe
> Traceback (most recent call last):
>   File "<string>", line 70, in <module>
>   File "<string>", line 67, in GdbSetPythonDirectory
>   File "c:\mingw\share\gdb/python\gdb\__init__.py", line 19, in <module>
>     import _gdb
> ImportError: No module named _gdb

Likely, an external ("C") extension (named "_gdb") must be build
(and installed) - and apparently, this is not yet done in your installation.

[toc] | [prev] | [next] | [standalone]


#72430

FromMarcelo Sardelich <msardelich@gmail.com>
Date2014-06-02 10:22 -0700
Message-ID<9dced0b1-9423-4c61-b640-78a261b93637@googlegroups.com>
In reply to#72394
Didier thanks for your prompt reply.

I installed a pre-built version of Python.
As you said, probably something is missing.

I tried to google packages related to gdb, but ain't had no luck.

Do you have any idea if it is a compiler directive? I mean I can compile Python from source. Not a problem.

Let me know..

On Monday, June 2, 2014 7:07:22 AM UTC+1, dieter wrote:
> Marcelo Sardelich <msardelich@gmail.com> writes:
> 
> > So I'm trying to implement pretty printing information using gdb-python27 on Windows7
> 
> >
> 
> > Hopefully, someone experienced the same issue.
> 
> >
> 
> > GDB is working fine, but when I run gdb-python27 I got the following error (related to a python import):
> 
> >
> 
> > C:\MinGW\bin>gdb-python27.exe
> 
> > Traceback (most recent call last):
> 
> >   File "<string>", line 70, in <module>
> 
> >   File "<string>", line 67, in GdbSetPythonDirectory
> 
> >   File "c:\mingw\share\gdb/python\gdb\__init__.py", line 19, in <module>
> 
> >     import _gdb
> 
> > ImportError: No module named _gdb
> 
> 
> 
> Likely, an external ("C") extension (named "_gdb") must be build
> 
> (and installed) - and apparently, this is not yet done in your installation.

[toc] | [prev] | [next] | [standalone]


#72477

Fromdieter <dieter@handshake.de>
Date2014-06-03 08:11 +0200
Message-ID<mailman.10597.1401775928.18130.python-list@python.org>
In reply to#72430
Marcelo Sardelich <msardelich@gmail.com> writes:

> Didier thanks for your prompt reply.
> I installed a pre-built version of Python.
> As you said, probably something is missing.
>
> I tried to google packages related to gdb, but ain't had no luck.

The missing part is related to the gdb-Python integration.
Look around for information about this integration - e.g.
installation instructions.

What is missing is apparently a C extension for Python. When you have
the source of this package, then it may contain a "setup.py".
In this case "[sudo] python setup.py install" may do everything necessary
to get a working C extension.


> Do you have any idea if it is a compiler directive?

Not for this problem.

However, using "gdb" usually profits considerably from
having debugging symbols. A system installed Python usually
lacks those symbols. Therefore, after you have solved
the current problem, it may be profitable to compile your
own Python from source.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web