简体   繁体   English

Windows 7上的Mutagen for Python不起作用

[英]Mutagen for Python on Windows 7 does not work

I have been using the mutagen package (version - mutagen-1.20) for Python 2.7 on my Windows 7 machine for sometime now, unfortunately it stopped working earlier today. 我已经在我的Windows 7机器上使用mutagen软件包(版本 - mutagen-1.20)一段时间了,不幸的是它今天早些时候停止了工作。

I have re-installed the package, deleted all files that belong to this package and again re-installed it all over, but all efforts were in vain. 我已经重新安装了软件包,删除了属于这个软件包的所有文件并再次重新安装,但所有的努力都是徒劳的。 What confuses me is that all this was working well till yesterday. 令我感到困惑的是,直到昨天这一切都运作良好。 Can someone point to me what might be wrong. 有人能指出我可能出错的地方。 I have mentioned below some code and logs for reference. 我在下面提到了一些代码和日志以供参考。 Thanks! 谢谢!

I also have eyed3 package installed and this is working well for the same mp3 file being used here. 我也安装了eyed3软件包,这对于这里使用的同一个mp3文件效果很好。 Unfortunately eyed3 isnt as impressive as mutagen and I am stuck in this strange situation. 不幸的是,eyed3并没有像诱变剂一样令人印象深刻,我陷入了这种奇怪的境地。

mutagen.py - Python code used for testing (example.mp3 is in the same directory where the script is): mutagen.py - 用于测试的Python代码(example.mp3与脚本所在的目录相同):

from mutagen.mp3 import MP3
audio = MP3("example.mp3")
print audio.info.length, audio.info.bitrate

Error Log from command prompt: 错误从命令提示符记录:

C:\Python27>python mutagen.py
Traceback (most recent call last):
  File "mutagen.py", line 1, in <module>
    from mutagen.mp3 import MP3
  File "C:\Python27\mutagen.py", line 1, in <module>
    from mutagen.mp3 import MP3
ImportError: No module named mp3

Name your python file something else. 将您的python文件命名为其他内容。 Because it's named mutagen.py your import statement is getting the wrong module. 因为它的名字mutagen.py你的import语句得到了错误的模块。 Try mutagen_test.py. 试试mutagen_test.py。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM