can't import dl module

Discussion in 'Python' started by Steven D. Arnold, Oct 3, 2003.

  1. Hi,

    I'm on Mac OS X 10.2.6, using Python 2.3final. I would like to use the dl
    module to get access to some system calls, in particular kvm_getprocs.
    However, when I try to import dl at the Python command-line, it tells me it
    couldn't find the module.

    It would seem I have to do something special to get dl to build on my
    machine. Does anyone know what that would be? Or is there some other
    problem that prevents this from working?

    Alternatively, does anyone know what else I could do to get at those calls?
    Perhaps I could try SWIG, but that seems like a hassle compared to dl.

    Thanks,
    steve
     
    Steven D. Arnold, Oct 3, 2003
    #1
    1. Advertising

  2. Steven D. Arnold

    Just Guest

    In article <>,
    "Steven D. Arnold" <> wrote:

    > I'm on Mac OS X 10.2.6, using Python 2.3final. I would like to use the dl
    > module to get access to some system calls, in particular kvm_getprocs.
    > However, when I try to import dl at the Python command-line, it tells me it
    > couldn't find the module.
    >
    > It would seem I have to do something special to get dl to build on my
    > machine. Does anyone know what that would be? Or is there some other
    > problem that prevents this from working?
    >
    > Alternatively, does anyone know what else I could do to get at those calls?
    > Perhaps I could try SWIG, but that seems like a hassle compared to dl.


    I've never heard of the "dl" module, and Python definitely come with
    such a module by default. That said, look for ctypes, it sounds like it
    does what you want. By the way, if you used the binary Python.framework
    installer, you should have an app called "PackageManager" in
    /Application/MacPython-2.3. Then use Bob Ippolito's package repository,
    it contains ctypes (see http://www.python.org/packman/). That should
    save you the trouble of having to build ctypes yourself.

    Just
     
    Just, Oct 3, 2003
    #2
    1. Advertising

  3. Steven D. Arnold

    John J. Lee Guest

    Just <> writes:

    > In article <>,

    [...]
    > I've never heard of the "dl" module, and Python definitely come with
    > such a module by default. That said, look for ctypes, it sounds like it

    [...]

    It's a unix-only dlopen wrapper, part of Python standard library.


    John
     
    John J. Lee, Oct 5, 2003
    #3
  4. Steven D. Arnold

    Just Guest

    In article <>, (John J. Lee)
    wrote:

    > Just <> writes:
    >
    > > In article <>,

    > [...]
    > > I've never heard of the "dl" module, and Python definitely come with
    > > such a module by default. That said, look for ctypes, it sounds like it

    > [...]
    >
    > It's a unix-only dlopen wrapper, part of Python standard library.


    Ah, interesting. In that case it could probably be made to work on
    MacOSX as well: there's a dlopen emulation for OSX, ctypes uses that if
    I recall correctly.

    Just
     
    Just, Oct 5, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page