mingus python_ImportError:使用Mingus库时,没有名为“ mt_exceptions”的模块

Forgive my ignorance in advance, I am very new to python. I am trying to use a python 3 version (https://code.google.com/r/artdent-mingus-python3/) of the Mingus library (https://pypi.python.org/pypi/mingus/) in 3.4.2. When trying to use the note module, I keep getting the ImportError listed in the title.

Based on my research on similar ImportError questions, I have tried the following things:

-I made sure there was a mt_exceptions.py file in the relevant directory

-I made sure each mingus directory in the site-packages directory has init.py file

-I deleted the .pyc files in the mingus directory

Any pointers on what I might try next?

解决方案

I've solved the problem by manually entering in "C:\Python34\Lib\site-packages\mingus\core" and editing the file (In my case, I had to edit notes.py from "from mt_exceptions import NoteFormatError, RangeError, FormatError" to "from mingus.core.mt_exceptions import NoteFormatError, RangeError, FormatError", and then I got a typical Python 2.x running on 3.x dict error. So that's the problem!

Solution: Use Python 2.x, or update the whole schmere to 3.x (That's what I'm doing).

As you can see here, Python 3.x has changed the import syntax a bit, and that's exactly what's happening. I had to run 2to3 through all the mingus source code and fix the imports manually from all files (Basically, porting the whole thing to Python 3.x).

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值