pythonpydbg

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

Solution

  • 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.