ImportError: cannot import name 'izip & TypeError: 'float' object cannot be interpre
Posted pprp
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ImportError: cannot import name 'izip & TypeError: 'float' object cannot be interpre相关的知识,希望对你有一定的参考价值。
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 interpre的主要内容,如果未能解决你的问题,请参考以下文章
解决 ImportError: cannot import name pywrap_tensorflow
ImportError: cannot import name webdriver
ImportError: cannot import name patterns
window环境下ImportError: cannot import name 'Bar' from 'pyecharts'