Python魔术无法找到libmagic

Python魔术无法找到libmagic

本文介绍了Python魔术无法找到libmagic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用pip install python-magic下载并安装了python-magic。
资料来源:

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

它下载并安装完好。我还将3个文件(cygmagic-1.dll,cygwin1.dll和cygz.dll)从cygwin安装复制到C:\Windows\System32。

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.

然后,我也下载了magic1.dll并将其放在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:找不到libmagic。检查您的安装

ImportError: failed to find libmagic. Check your installation

为什么是这样?

编辑:我已经包括C:\cygwin \\ p进入PATH。

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

推荐答案

哦,我只需要重新启动计算机才能正常工作。但是最终,由于32位和64位不兼容性错误,我仍然使用python-magic有问题。我想通过检查扩展名来检查文件类型。哦,好的。

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.

这篇关于Python魔术无法找到libmagic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 19:23