473,394 Members | 1,759 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,394 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 1912
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.