AttributeError: ‘method_descriptor‘ object has no attribute ‘today‘
程序员文章站
2022-03-07 09:32:14
...
错误:AttributeError: ‘method_descriptor’ object has no attribute ‘today’
出错代码:
yesterday = datetime.date.today() - datetime.timedelta(days=1)
yesterday_timestamp = int(time.mktime(yesterday.timetuple())) * 1000
导入原句:
from datatime import *
按提示改成:
import datetime
解决。
推荐阅读
-
python错误:AttributeError: 'module' object has no attribute 's
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
python编程排除163邮箱发送邮件报错(AttributeError: ‘tuple‘ object has no attribute ‘encode‘)
-
AttributeError: module ‘community‘ has no attribute ‘best_partition‘ 问题解决方法
-
【python】解决AttributeError: module ‘scipy.misc‘ has no attribute ‘toimage‘问题
-
【Tensorflow】Linux下Tensorflow报错:AttributeError: module ‘tensorflow‘ has no attribute ‘xxxx‘
-
AttributeError: 'module' object has no attribute 'main'
-
AttributeError: module 'sklearn' has no attribute 'linear_model'
-
解决Keras报错AttributeError: 'NoneType' object has no attribute 'inbound_nodes'
-
解决'DataFrame' object has no attribute 'sort'