运行时出现错误AttributeError: 'NoneType' object has no attribute 'format'

运行时出现如下的报错

import pandas as pd
import numpy as np

print("Missing required dependencies {values}".format(values = ['aaa', 'bbb'])
AttributeError: 'NoneType' object has no attribute 'format'

.format必须放到print语句里面

print("Missing required dependencies {values}".format(values = ['aaa', 'bbb']))

结果

Missing required dependencies ['aaa', 'bbb']

显示正常了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章