pynetwork / pypcap

pypcap - python libpcap module, forked from code.google.com/p/pypcap
Other
299 stars 74 forks source link

attribute error running setup.py for 1.1.5 #20

Closed dsayling closed 8 years ago

dsayling commented 8 years ago

Found pcap headers in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/pcap/pcap.h Found libraries in None Traceback (most recent call last): File "", line 1, in File "/private/tmp/pip-build-aAY0gL/pypcap/setup.py", line 59, in lib_file = os.path.basename(lib_file_path) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 114, in basename i = p.rfind('/') + 1 AttributeError: 'NoneType' object has no attribute 'rfind'

Will attempt to debug.

brifordwylie commented 8 years ago

@dayling Okay I ran into the same issue. Not an expert but I ^think^ the headers are found here: -/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/pcap/pcap.h

And the libpcap library is found here: /usr/lib/libpcap.dylib

The current 'finding' logic in setup.py will search lots of places for the headers and then uses the directory that it found pcap.h in as a root point to find the libs. Works well on linux but not with the default OSX setup. I'm making a PR that adds '/usr/lib' to the END of the directories that get searched for libs, the PR should have no negative consequences as the /usr/lib is added to the END of the search.

brifordwylie commented 8 years ago

closing with the merge of #23