Python-magic not recognized while trying to import in Django

108 Views Asked by At

I am trying to check the file type of the uploaded data using magic but pylance is not recognizing it I keep getting this error pylance error

I installed python-magic 0.4.27 My python version is- 3.9 Django-version- 4.1.3

I tried adding python-magic to Installed Apps in Settings after Installing it locally on my command prompt I also Installed python-magic-bin-0.4.14 but it still gives me that error. pylance error

1

There are 1 best solutions below

0
On

python-magic is a Python interface to the libmagic file type identification library. libmagic identifies file types by checking their headers according to a predefined list of file types.

You have install in virtual environment with "pip install python-magic"