Python3 Magic for a Django project

Question:

I need the python-magic package for a Django project. However, I found out that since I am using python3, I need the python3-magic package, which I can either get using pip3 or using apt-get.
I am a macOS user, so I don’t have an apt-get, and I cannot install the package using pip3. It gives me the following error when I type: pip3 install python3-magic.

ERROR: Could not find a version that satisfies the requirement python3-magic (from versions: none)
ERROR: No matching distribution found for python3-magic

Is there any way I can get this package for my Django project? No matter what I do, the package appears uninstalled on my VS Code.

Asked By: Panda

||

Answers:

If you install this through pip3, the name of the package is python-magic [PyPi], not python3-magic, so:

pip3 install python-magic

If you use apt-get, you can work with python3-magic and python-magic. These are not links to a Python package, but in essence intallations scripts that will work with pip3 and pip respectively. See for example the files of the python3-magic package [ubuntu-packages].

Answered By: Willem Van Onsem
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.