我在windows下,执行下面的命令,python是2.7,提示出错AttributeError: 'tuple' object has no attribute 'value',这是为啥呢?
D:\temp>python -V
Python 2.7.18
D:\temp>
D:\temp>type test.py
import datetime
from chinese_calendar import is_workday
date = datetime.datetime.now().date()
if is_workday(date):
print("work day")
else:
print("holidy day")
D:\temp>
D:\temp>python test.py
Traceback (most recent call last):
File "test.py", line 4, in
from chinese_calendar import is_workday
File "C:\Python27\lib\site-packages\chinese_calendar__init__.py", line 4, in
from .constants import Holiday, holidays, in_lieu_days, workdays
File "C:\Python27\lib\site-packages\chinese_calendar\constants.py", line 31, in
datetime.date(year=2004, month=1, day=1): Holiday.new_years_day.value,
AttributeError: 'tuple' object has no attribute 'value'
我在windows下,执行下面的命令,python是2.7,提示出错AttributeError: 'tuple' object has no attribute 'value',这是为啥呢?
D:\temp>python -V
Python 2.7.18
D:\temp> D:\temp>type test.py import datetime from chinese_calendar import is_workday
date = datetime.datetime.now().date() if is_workday(date): print("work day") else: print("holidy day")
D:\temp> D:\temp>python test.py Traceback (most recent call last): File "test.py", line 4, in
from chinese_calendar import is_workday
File "C:\Python27\lib\site-packages\chinese_calendar__init__.py", line 4, in
from .constants import Holiday, holidays, in_lieu_days, workdays
File "C:\Python27\lib\site-packages\chinese_calendar\constants.py", line 31, in
datetime.date(year=2004, month=1, day=1): Holiday.new_years_day.value,
AttributeError: 'tuple' object has no attribute 'value'