pynetwork / pypcap

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

Can't install: AttributeError: 'NoneType' object has no attribute 'rfind' #33

Closed hellais closed 6 years ago

hellais commented 7 years ago

This was reported on: https://github.com/dugsong/pypcap/issues/49.

There seem to be some reported fixes in there we could integrate into our setup.py

bassosimone commented 7 years ago

Also noticed this on macOS 10.12.1 (Sierra) and fixed it by installing dupes/libpcap with homebrew.

Here is the stacktrace of the error I was getting:

  Using cached pypcap-1.1.5.tar.gz
    Complete output from command python setup.py egg_info:
    Found pcap headers in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pcap/pcap.h
    Found libraries in None
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/bl/r84rmchd6c5848k6gxvvky_m0000gn/T/pip-build-oPKzJ5/pypcap/setup.py", line 59, in <module>
        lib_file = os.path.basename(lib_file_path)
      File "/XXXX/fff/bin/../lib/python2.7/posixpath.py", line 114, in basename
        i = p.rfind('/') + 1
    AttributeError: 'NoneType' object has no attribute 'rfind'
ivandov commented 7 years ago

+1 Also have this issue installying pypcap on OSX 10.12.3

hellais commented 7 years ago

I believe this should be fixed in the current master. If you could check that is indeed the case this would be very useful.

I plan to anyways make a long due new release and push to pypi that should address this.

ghost commented 7 years ago

I have the same problem on ubuntu16.04,python 2.7 and i solve this problem by "apt-get install libpcap-dev"

hellais commented 7 years ago

I have the same problem on ubuntu16.04,python 2.7 and i solve this problem by "apt-get install libpcap-dev"

Yes libpcap-dev is in fact a dependency of pypcap as is listed in the Readme. We should probably provide a better error message when this happens in the setup.py though. I filed an issue for that last thing here: https://github.com/pynetwork/pypcap/issues/51.

hellais commented 6 years ago

This fix is now shipped as part of 1.2.0