Why is Module python-magic not available?

6.6k views Asked by At

I am using s3cmd to sync to an S3 bucket from a Mac and I am getting the following warning:

WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.

But pip list shows that python-magic is in fact installed.

Package      Version
------------ -------
pip          19.3.1 
python-magic 0.4.15 
setuptools   42.0.2 
wheel        0.33.6 

And python --version shows

Python 3.7.5

And pip --version shows

pip 19.3.1 from /usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip (python 3.7)

How can I fix this issue?

2

There are 2 answers

0
edgars On BEST ANSWER

Verify if import magic (the code that fails in s3cmd) works by running python -c 'import magic' in command line.

If it doesn't, you probably need libmagic installed. Try brew install libmagic.

0
Drawn Yang On

In the s3cmd manual,there is a argument: --no-mime-magic. If you use it, there is no warning.

./s3cmd --help | grep magic 

With this command you will find it.