python import module troubleshooting

用到了一个叫做munkres的库

但每次import的时候都出现了问题

后来找到问题是我自己的python file 命名为munkres.py 

所以每次它import 的时候都是import 我自己的python file 

python 这一点也挺不好的,感觉就是很随意的,interpreter一脸懵逼?

还有问题是不是很多库都是python2 和python3 共同使用的,就是没有冲突,为了验证这一点我还特意搞了python2的环境,结果是没有冲突。

Traceback (most recent call last):
  File "f:/PythonDev/benchmarks/scripts/import_munres.py", line 5, in <module>

ImportError: cannot import name 'Munkres' from 'munkres' (f:\PythonDev\benchmarks\scripts\munkres.py)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值