krmaxwell / maltrieve

A tool to retrieve malware directly from the source for security researchers.
GNU General Public License v3.0
563 stars 184 forks source link

AttributeError: 'module' object has no attribute 'from_buffer' #175

Closed zam89 closed 9 years ago

zam89 commented 9 years ago

Hi, I have this problem when run the maltrive:

Traceback (most recent call last):
  File "maltrieve.py", line 514, in <module>
    main()
  File "maltrieve.py", line 503, in main
    if save_malware(each, cfg):
  File "maltrieve.py", line 302, in save_malware
    mime_type = magic.from_buffer(data, mime=True)
AttributeError: 'module' object has no attribute 'from_buffer'

This is the output from pip freeze:

# pip freeze
androguard==3.0
aspy.yaml==0.2.1
beautifulsoup4==4.4.0
bitstring==3.1.3
bottle==0.12.8
cached-property==1.2.0
cffi==1.1.2
cov-core==1.15.0
coverage==3.7.1
coveralls==1.0a2
cryptography==0.9.3
Cython==0.22.1
distorm3==3.3.0
dnspython==1.12.0
docopt==0.6.2
enum34==1.0.4
feedparser==5.2.0
functools32==3.2.3.post2
gevent==1.1b2.dev0
GnuPGInterface==0.3.2
greenlet==0.4.7
grequests==0.2.0
idna==2.0
ipaddress==1.0.14
jsonschema==2.5.1
LinkChecker==9.3
lxml==2.3.2
M2Crypto==0.22.3
Magic-file-extensions==0.2
maltrieve==0.7
Markdown==2.6.2
mastiff==0.7.1
ndg-httpsclient==0.4.0
nodeenv==0.13.3
olefile==0.42.1
oletools==0.12
ordereddict==1.1
pefile==1.2.10.post142
peframe==4.2
pre-commit==0.5.3
prettytable==0.7.2
py==1.4.30
pyasn1==0.1.8
pycparser==2.14
pycrypto==2.6.1
pycurl==7.19.0
pydeep==0.2
pyelftools==0.23
PyExifTool==0.1
pylzma==0.4.6
pyOpenSSL==0.15.1
pysqlite==1.0.1
pytest==2.7.2
pytest-cov==1.8.1
python-apt===0.8.3ubuntu7.3
python-coveralls==2.5.0
python-magic==0.4.6
python-socksipy==1.0
PyYAML==3.11
requests==2.7.0
sh==1.11
simplejson==3.8.0
six==1.9.0
SQLAlchemy==1.0.7
ssdeep===2.0-0.1
unattended-upgrades==0.1
virtualenv==13.1.0
wheel==0.24.0
Yapsy==1.11.223
yara-python==3.4.0

I believe I've installed the python-magic via pip. But the error still occur. Any guide to solve this? Thanks.

zam89 commented 9 years ago

Nah. It's ok now. I just run pip uninstall python-magic several time. Then I confirm back by pip freeze. Then I try installing back the package back. Try run the maltrieve and everything works fine. :)