我按照这里的说明...
https://github.com/ahupp/python-magic#dependencies
我运行了 pip install python-magic 并且安装没有任何问题。然后我安装了 cygwin 并将 C:\cygwin\bin 添加到我的系统路径中。当我在 Windows 命令提示符下运行 python 解释器并导入魔法时,我得到了这个错误......
Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import magic
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\magic.py", line 161, in <module>
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation
>>>
我错过了一步吗?