module 'datetime' has no attribute 'now'的可能的一种解决方式

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xckkcxxck/article/details/82977872

我报这个错:module 'datetime' has no attribute 'now',其原因为我导入包的时候写的是:import datetime

而调用的时候写的是datetime.now()   

其实应该写成datetime.datetime.now()

猜你喜欢

转载自blog.csdn.net/xckkcxxck/article/details/82977872