Can't get 0.5 to build under Python 2.4

Help
2005-10-05
2013-05-09
  • Grant Edwards

    Grant Edwards - 2005-10-05

    Attempting to build vanilla 0.5 under Python 2.4 on a Mandrake 10.1 system:

    $ python setup.py build
    /usr/lib/python2.4/distutils/dist.py:222: UserWarning: 'licence' distribution option is deprecated; use 'license'
      warnings.warn(msg)
    running build
    running build_ext
    building '_pcapmodule' extension
    Traceback (most recent call last):
      File "setup.py", line 187, in ?
        cmdclass = {'clean': pcapclean,
      File "/usr/lib/python2.4/distutils/core.py", line 149, in setup
        dist.run_commands()
      File "/usr/lib/python2.4/distutils/dist.py", line 946, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.4/distutils/command/build.py", line 112, in run
        self.run_command(cmd_name)
      File "/usr/lib/python2.4/distutils/cmd.py", line 333, in run_command
        self.distribution.run_command(command)
      File "/usr/lib/python2.4/distutils/dist.py", line 966, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.4/distutils/command/build_ext.py", line 279, in run
        self.build_extensions()
      File "/usr/lib/python2.4/distutils/command/build_ext.py", line 405, in build_extensions
        self.build_extension(ext)
      File "/usr/lib/python2.4/distutils/command/build_ext.py", line 442, in build_extension
        sources = self.swig_sources(sources, ext)
    TypeError: swig_sources() takes exactly 2 arguments (3 given)

    After googling for that error message, I took a WAG and chagned setup.py:

      def swig_sources(self, sources, extension=None):
         
          """Walk the list of source files in 'sources', looking for SWIG
          interface (.i) files.  Run SWIG on all that are found, and

    I've no idea what that does, since I've never used SWIG, but it was suggested for somebody else who ran into the same error with a different extension package.  It gets further, but still doesn't build:

    $ python setup.py build
    /usr/lib/python2.4/distutils/dist.py:222: UserWarning: 'licence' distribution option is deprecated; use 'license'
      warnings.warn(msg)
    running build
    running build_ext
    building '_pcapmodule' extension
    generating constants.c from mk-constants.py
    swig -python -shadow -ISWIG -o pcap.c pcap.i
    pcap.i:23: Error: Unable to find 'doc.i'
    error: command 'swig' failed with exit status 1

    Any idea how to get pylibpcap to build under Python 2.4?

     
    • Brandon N

      Brandon N - 2005-10-07

      I'm having the same issue.

       
      • Grant Edwards

        Grant Edwards - 2005-10-07

        The current tarball is pretty much broken. There are three things you need to do to get pylibpcap to build with a current version of Python:

        1) Change to setup.py to make it compatible with the current distutils.

        2) Then you have to go grab from CVS the files that are missing from the tarball: doc.i and the build-tools directory and the files in it.

        3) Change to pcap.py to keep if from trying to set __doc__ attributes (they're not writable).

        Since there doesn't seem to be a way to attach a file to a post  or prevent pasted text from getting munged [god, how I hate web-forums], I've put the patches at

        ftp://ftp.visi.com/users/grante/python/pylibpcap/

         
        • Wim Lewis

          Wim Lewis - 2005-11-18

          I think yesterday's 0.5.1 release has fixed these problems...

           
    • Brandon N

      Brandon N - 2005-10-07

      In an effort to contain the information to it's source:

      Check out the CVS. The tar.gz is missing some files.

      Hacking setup.py by altering line 78:
      - def swig_sources(self, sources):
      + def swig_sources(self, sources, extension=None):

      From here I can setup.py build and install.

      When I go to run the examples:
      $ python examples/findalldevs.py
      []

      $ python examples/sniff.py 80 test
      Traceback (most recent call last):
        File "examples/sniff.py", line 68, in ?
          p = pcap.pcapObject()
        File "/usr/lib/python2.4/site-packages/pcap.py", line 78, in __init__
          self.datalink.__setattr__('__doc__',_pcap.pcapObject_datalink.__doc__)
      TypeError: attribute '__doc__' of 'instancemethod' objects is not writable

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks