gpt4 book ai didi

python - 异常值 :failed to find libmagic. 检查您在 Windows 7 中的安装

转载 作者:IT老高 更新时间:2023-10-28 21:02:15 26 4
gpt4 key购买 nike

当我尝试打开 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

Here is my traceback

最佳答案

前往 here然后:

对于Windoes 32bit,下载文件“python_magic_bin-0.4.14-py2.py3-none-win32.whl”并运行

pip install python_magic_bin-0.4.14-py2.py3-none-win32.whl

对于Windows 64bit,下载“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

现在 python-magic 可以工作了

enter image description here

编辑:正如评论中所建议的,这也有效:

pip install python-magic-bin==0.4.14

关于python - 异常值 :failed to find libmagic. 检查您在 Windows 7 中的安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18374103/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com