ydkhatri / mac_apt

macOS (& ios) Artifact Parsing Tool
https://swiftforensics.com
MIT License
779 stars 100 forks source link

AttributeError: module 'collections' has no attribute 'MutableSet' #89

Closed mailinglists35 closed 1 year ago

mailinglists35 commented 1 year ago
user@macmini Downloads % sh ./mac_aptInstall-macOS-v21.sh 

[*] mac_apt Installation Script for macOS - Version 2.1
-----------------------------------------------------------
[!] This script requires sudo privileges.
[*] Would you like to specify an installation directory? [Y/n] n
[~] Installing mac_apt to /Users/user/Downloads...
[~] Ensuring Homebrew is up-to-date...
[+] Installing virtualenv...
[+] Downloading mac_apt from GitHub...
[+] Creating virtual environment with virtualenv...
[+] Installing pybindgen...
[+] Installing pyaff4...
[+] Installing pytsk...
[+] Installing pyvmdk...

^ here I hit the "fatal error: 'libintl.h' file not found" issue, solved by linking /usr/local/include/libintl.h into /Users/user/Downloads/mac_apt/env/include/ then I stumbled into missing libclocale_support.c which I solved by manually compiling from github

Installing wget...
[+] Installing pyewf...
[+] Installing other dependencies...
[*] mac_apt successfully downloaded and installed!
------------------------------------------------------------------------------
 To run mac_apt, you will have to go to the mac_apt folder
 and then enter the virtual environment using the following command 
   source env/bin/activate 
 Then run mac_apt as you would normally 
   python3 mac_apt.py ....
user@macmini Downloads % cd mac_apt
user@macmini mac_apt % source env/bin/activate
(env) user@macmini mac_apt % python3 mac_apt.py 
Traceback (most recent call last):
  File "/Users/user/Downloads/mac_apt/mac_apt.py", line 31, in <module>
    from plugins.helpers.aff4_helper import EvidenceImageStream
  File "/Users/user/Downloads/mac_apt/plugins/helpers/aff4_helper.py", line 10, in <module>
    from pyaff4 import container
  File "/Users/user/Downloads/mac_apt/env/lib/python3.10/site-packages/pyaff4/container.py", line 23, in <module>
    from pyaff4 import data_store, aff4_image
  File "/Users/user/Downloads/mac_apt/env/lib/python3.10/site-packages/pyaff4/data_store.py", line 45, in <module>
    from pyaff4 import aff4_map
  File "/Users/user/Downloads/mac_apt/env/lib/python3.10/site-packages/pyaff4/aff4_map.py", line 21, in <module>
    import intervaltree
  File "/Users/user/Downloads/mac_apt/env/lib/python3.10/site-packages/intervaltree/__init__.py", line 22, in <module>
    from .intervaltree import IntervalTree
  File "/Users/user/Downloads/mac_apt/env/lib/python3.10/site-packages/intervaltree/intervaltree.py", line 37, in <module>
    class IntervalTree(collections.MutableSet):
AttributeError: module 'collections' has no attribute 'MutableSet'
jb-314 commented 1 year ago

Replace

Import collections

to

Import collections.abc as collections

on every python file that you encounter this error.

More info: https://stackoverflow.com/questions/74006130/attributeerror-module-collections-has-no-attribute-mutableset

ydkhatri commented 1 year ago

The dependency IntervalTree has been updated , and that fixes this issue. There is also a requirements.txt file now, so no need to install via this script now! I'll update the documentation on the wiki later.