首页 > 其他 > 详细

ImportError: cannot import name 'izip & TypeError: 'float' object cannot be interpreted as an integer

时间:2018-08-12 11:11:00      阅读:1137      评论:0      收藏:0      [点我收藏+]
  • ImportError: cannot import name ‘izip‘

参考:https://codereview.stackexchange.com/questions/26271/import-izip-for-different-versions-of-python

A common idiom that I use for Python2-Python3 compatibility is:

gedit mtcnn_detector.py

try:
    from itertools import izip
except ImportError:  #python3.x
    izip = zip

However, a comment on one of my Stack Overflow answers implies that there may be a better way. Is there a more clean way to accomplish this?

  • TypeError: ‘float‘ object cannot be interpreted as an integer

将报错的部分全部用int()包起来,强制进行类型转化

ImportError: cannot import name 'izip & TypeError: 'float' object cannot be interpreted as an integer

原文:https://www.cnblogs.com/pprp/p/9462056.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!