当我尝试打开 django 管理面板时,显示此错误:
ImportError at /admin/
failed to find libmagic. Check your installation
Request Method: GET
Request URL: Django Version: 1.5.1
Exception Type: ImportError
Exception Value: failed to find libmagic. Check your installation
Exception Location: C:\Python27\lib\site-packages\magic.py in <module>, line 131
Python Executable: C:\Python27\python.exe
Python Version: 2.7.2
Python Path:
['C:\\Users\\farhan\\Downloads\\dist\\Django-1.5.1\\django\\bin\\mysite',
'C:\\Python27\\lib\\site-packages\\distribute-0.6.49-py2.7.egg',
'C:\\Windows\\system32\\python27.zip',
'C:\\Python27\\DLLs',
'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win',
'C:\\Python27\\lib\\lib-tk',
'C:\\Python27',
'C:\\Python27\\lib\\site-packages',
'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg-info']
Server time: Thu, 22 Aug 2013 13:19:01 +0600
这是我的回溯 http://dpaste.com/1353012/
Go here https://pypi.python.org/pypi/python-magic-bin/0.4.14进而:
For Windows 32 位,下载文件“python_magic_bin-0.4.14-py2.py3-none-win32.whl”并运行
pip install python_magic_bin-0.4.14-py2.py3-none-win32.whl
For 视窗 64 位,下载“python_magic_bin-0.4.14-py2.py3-none-win_amd64.whl”并运行
pip install python_magic_bin-0.4.14-py2.py3-none-win_amd64.whl
now python-magic
works
EDIT:
正如评论中所建议的,这也有效:
pip install python-magic-bin==0.4.14
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)