user1415944
user1415944

Reputation: 65

PyDBG Python 2.7 error: "TypeError: 'module' object is not callable"

I am trying to use PyDBG with Python 2.7. I believe it is installed correctly.

import pydbg
dbg = pydbg()

Produces error when run:

Traceback (most recent call last):
File "[path removed..]\pydbg.py", line 1, in <module>
import pydbg
File "[path removed..]\pydbg.py", line 5, in <module>
dbg = pydbg()
TypeError: 'module' object is not callable

Upvotes: 1

Views: 1348

Answers (2)

&#211;scar L&#243;pez
&#211;scar L&#243;pez

Reputation: 236004

Try this:

from pydbg import pydbg
dbg = pydbg()

In general, you should add the name of an imported module before calling any of its members:

import pydbg
dbg = pydbg.pydbg()

EDIT :

Also, make sure that the file that contains your script is not named pydbg.py, because it'd conflict with the name of the module you're trying to import. As it turns out, that was the problem.

Upvotes: 2

Levon
Levon

Reputation: 143022

You probably have to do:

   dbg = pydbg.pydbg()

unless you specifically import pydbg from pydbg with

   from pydbg import pydbg

I prefer the former.

Upvotes: 1

Related Questions