USArmyResearchLab / Dshell

Dshell is a network forensic analysis framework.
Other
5.44k stars 1.14k forks source link

module 'distutils.sysconfig' has no attribute '_init_posix' #149

Closed eddocat closed 1 year ago

eddocat commented 2 years ago

There seems to be an issue with installing pcapy: https://github.com/helpsystems/pcapy/issues/73 which is preventing installation of DShell.

Collecting pcapy
  Downloading pcapy-0.11.4.tar.gz (37 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-nqz_zlei/pcapy_e1a8e2d5b3794862af12f48d4e4fdfdc/setup.py", line 49, in <module>
          save_init_posix = sysconfig._init_posix
      AttributeError: module 'distutils.sysconfig' has no attribute '_init_posix'
      [end of output]

It appears unlikely that pcapy will release a fix for the issue since the latest commit was back in 2019. A possible work around is to use pcapy-ng (https://github.com/stamparm/pcapy-ng/) instead pcapy. Update the pcapy to pcapy-ng in setup.py

    install_requires=[
        "geoip2",
        "pcapy-ng",
        "pypacker",
    ],
dev195 commented 1 year ago

We were seeing this too and switched to using pcapy-ng.

pcapy should be removed before using pcapy-ng because of a namespace conflict. Otherwise, pcapy-ng should work the same.

Thanks for reporting this issue.