Python-Magic ; Unable to find libmagic [duplicate]

扶醉桌前 提交于 2019-12-25 03:55:10

问题


I've downloaded and installed python-magic using "pip install python-magic". Source: https://github.com/ahupp/python-magic

It downloaded and installed perfectly fine. I've also copied the 3 files (cygmagic-1.dll, cygwin1.dll, and cygz.dll) from cygwin installation into C:\Windows\System32.

Then, I also downloaded magic1.dll and placed it in System32 folder too.

But the command prompt is still giving me this error:

ImportError: failed to find libmagic. Check your installation

Why is this so?

EDIT: I've included C:\cygwin\bin into PATH also.


回答1:


Make sure you also included

C:\cygwin\bin

in your system path. That seems to be the step missing.




回答2:


Oh I just have to restart the computer for it to work. But ultimately, I still have problems using python-magic because of the "32bit" and "64bit" incompatibility bug. I guess I'll just check the file type by checking the extensions. Oh well.



来源:https://stackoverflow.com/questions/24816887/python-magic-unable-to-find-libmagic

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!