473,240 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,240 software developers and data experts.

Can't get pylibpcap extension to build under 2.4

I've been using the pylibpcap extension module for several
years, but I can't get it to build under 2.4:

$ 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 around I tried this:
--- setup.py-old 2005-10-05 18:34:20.486133727 -0500
+++ setup.py 2005-10-05 18:34:44.281584035 -0500
@@ -68,21 +68,21 @@

def before_swig_sources(self, sources):
new_sources = [ ]
for source in sources:
if source == 'mk-constants.py':
self.make_file( (source,), 'constants.c', execfile, (source,) )
else:
new_sources.append(source)
return new_sources

- def swig_sources(self, sources):
+ 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
return a modified 'sources' list with SWIG source files replaced
by the generated C (or C++) files.
"""

sources = self.before_swig_sources(sources)

new_sources = []
I've never used SWIG, so I don't have any idea what's going on,
but it got a little bit further:

$ 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

And the files I end up with are:

-rw-r--r-- 1 grante grante 5336 Oct 5 18:36 constants.c
-rw-r--r-- 1 grante grante 395 Apr 23 2002 COPYING
-rw-r--r-- 1 grante grante 1100 Apr 28 2004 error.c
drwxr-xr-x 2 grante grante 4096 Jul 3 18:32 examples/
-rw-r--r-- 1 grante grante 958 Apr 28 2004 exception.c
-rw-r--r-- 1 grante grante 118 Jul 3 18:17 MANIFEST.in
-rw-r--r-- 1 grante grante 2068 Jun 7 2004 mk-constants.py
-rw-r--r-- 1 grante grante 54542 Jul 3 18:11 pcap.c
-rw-r--r-- 1 grante grante 4671 Jul 10 2004 pcap.i
-rw-r--r-- 1 grante grante 14929 Jul 9 2004 pcap_interface.c
-rw-r--r-- 1 grante grante 6011 Jul 3 18:11 pcap.py
-rw-r--r-- 1 grante grante 346 Jul 3 18:32 PKG-INFO
-rw-r--r-- 1 grante grante 2379 Dec 3 2004 pypcap.h
-rw-r--r-- 1 grante grante 1744 Jul 3 18:29 README
-rw-r--r-- 1 grante grante 100 Jun 14 2002 setup.cfg
-rwxr-xr-x 1 grante grante 6374 Oct 5 18:34 setup.py*
-rwxr-xr-x 1 grante grante 6358 Oct 5 18:34 setup.py-old*
Anybody have a clue to spare?

--
Grant Edwards grante Yow! I want DUSTIN
at HOFFMAN!! ... I want
visi.com LIBRACE!! YOW!!
Oct 5 '05 #1
1 1908
On 2005-10-05, Grant Edwards <gr****@visi.com> wrote:
I've been using the pylibpcap extension module for several
years, but I can't get it to build under 2.4:


It turns out the .tar.gz file being distributed is missing the
file doc.i and the entire build-tools subdirectory. If you
grab the missing stuff from CVS it builds and installs after
you hack setup.py as shown in the previous post.

Don't know if it _works_ yet...

--
Grant Edwards grante Yow! I'll show you MY
at telex number if you show
visi.com me YOURS...
Oct 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joonas Paalasmaa | last post by:
Hi, When compiling Sketch's streamfilter C extension the errors below are raised during linking. What could cause the errors? (Python 2.3, MinGw 1.1 with GCC 2.95.3-6, Windows 98) Here are...
0
by: Evan | last post by:
Hi, I'm a new hire with python program, I want to write script for changing/moniter/filter the network packet, it seems there are two extensions in python, pycap and pylibcap. I was confused,...
0
by: Evan | last post by:
A web-link would do, becuase of I don't know how many parameters I need to use in function about pylibpcap. Or what kind of parameters I need to use/transfer? I'm very gratefully if you can...
0
by: Akira Kitada | last post by:
Hi list, I was trying to build Python 2.6 on FreeBSD 4.11 and found it failed to build some of the modules. """ Failed to find the necessary bits to build these modules: _bsddb ...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.