-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
failed when I install pypcap on Mac with Python 2.7 #115
Comments
It's deprecated because, at least in some versions of NetBSD, it has a different function signature ("different" as in "different number of arguments") from the one in libpcap and other platforms. if pypcap can switch to using those routines if
That one's even worse - it's not thread-safe (I guess making its static data thread-local would fix that), and, if you support Windows, it returns UTF-16 strings, at least on NT-based Windows - not ASCII/UTF-8/local code page strings - and changing that would break binary compatibility with programs using WinPcap or Npcap. If pypcap can switch to, as the deprecation warning says, "[using] 'pcap_findalldevs' and [using] the first device", it should. If it can't, because it's directly exporting a pcap_lookupdev-based API and can't implement it atop
That probably will not work on Catalina or later, as they don't support 32-bit binaries, meaning none of the system libraries include 32-bit x86 code. If pypcap defaults to building universal binaries, it should not do so on Catalina, and should build x86-64/ARM64 universal binaries, not IA-32/x86-64 universal binaries, on post-Catalina releases. If pypcap doesn't default to building universal binaries, people trying to install pypcap shouldn't do anything that would override that if they're building on Catalina or later. |
(Unless the universal-binary problem is a Python 2/pip2 problem.) |
My macOS is Monterey 12.6.5, It's successful with "pip2 install pypcap" on my another macOS Big Sur. So may I try to reinstall python 2.7/pip2 on my first macOS? |
I solve it, thanks also. pip2 install pypcap |
I need to install pypcap with Python 2 on Mac.
It failed when I use source install: python2 setup.py install
pcap_ex.c:292:10: warning: 'pcap_compile_nopcap' is deprecated: use pcap_open_dead(), pcap_compile() and pcap_close() [-Wdeprecated-declarations]
return (pcap_compile_nopcap(snaplen, dlt, fp, str, optimize, netmask));
^
/usr/local/include/pcap/pcap.h:617:1: note: 'pcap_compile_nopcap' has been explicitly marked deprecated here
PCAP_DEPRECATED("use pcap_open_dead(), pcap_compile() and pcap_close()")
^
/usr/local/include/pcap/funcattrs.h:307:47: note: expanded from macro 'PCAP_DEPRECATED'
#define PCAP_DEPRECATED(msg) attribute((deprecated(msg)))
^
2 warnings generated.
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/pcap.o build/temp.macosx-10.6-intel-2.7/pcap_ex.o -L/usr/local/lib -lpcap -o build/lib.macosx-10.6-intel-2.7/pcap.so
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/lib/libpcap.dylib, missing required architecture i386 in file /usr/local/lib/libpcap.dylib (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
ld: dynamic main executables must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
It also failed when I use pip install: pip2 install pypcap
/usr/local/include/pcap/pcap.h:394:1: note: 'pcap_lookupdev' has been explicitly marked deprecated here
PCAP_DEPRECATED("use 'pcap_findalldevs' and use the first device")
^
/usr/local/include/pcap/funcattrs.h:307:47: note: expanded from macro 'PCAP_DEPRECATED'
#define PCAP_DEPRECATED(msg) attribute((deprecated(msg)))
^
pcap_ex.c:292:10: warning: 'pcap_compile_nopcap' is deprecated: use pcap_open_dead(), pcap_compile() and pcap_close() [-Wdeprecated-declarations]
return (pcap_compile_nopcap(snaplen, dlt, fp, str, optimize, netmask));
^
/usr/local/include/pcap/pcap.h:617:1: note: 'pcap_compile_nopcap' has been explicitly marked deprecated here
PCAP_DEPRECATED("use pcap_open_dead(), pcap_compile() and pcap_close()")
^
/usr/local/include/pcap/funcattrs.h:307:47: note: expanded from macro 'PCAP_DEPRECATED'
#define PCAP_DEPRECATED(msg) attribute((deprecated(msg)))
^
2 warnings generated.
creating build/lib.macosx-10.6-intel-2.7
/usr/bin/clang -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/pcap.o build/temp.macosx-10.6-intel-2.7/pcap_ex.o -L/usr/local/lib -lpcap -o build/lib.macosx-10.6-intel-2.7/pcap.so
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /usr/local/lib/libpcap.dylib, missing required architecture i386 in file /usr/local/lib/libpcap.dylib (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
ld: dynamic main executables must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
The text was updated successfully, but these errors were encountered: