The third party module was imported manually and the error was invoked during the call, and the script was invoked as follows:
From Hivetask import hivetask
ht = Hivetask ()
#ht. Calendar.setmonth ( -12)
print ( Ht.calendar.getMonthFirst ()) print (Ht.calendar.getMonthLast ()) print (
ht.calendar.getYearWeek ())
The error message is as follows:
File "d:/winpython/winpython-64bit-3.4.3.7/python-3.4.3.amd64/scripts/workspaces/20160329.py", line < module>
ht = Hivetask ()
File "C:\Python34\Lib\site-packages\jd_127environment\HiveTask.py", line, in __ init__
self.username = os.environ[' USER '
File ' D:\winpython\WinPython-64bit-3.4.3.7\ python-3.4.3.amd64\lib\os.py ", line 633, in __getitem__
raise Keyerror (key) from None
keyerror: ' USER '
Analysis Reason:
When Self.username is invoked in hivetask.py, the user variable throws an exception: Raise Keyerror (Key) from None.
Indicates that there is no user this environment variable in the window environment, but there is a username variable in the environment variable, just in line with the requirements of the Self.username, to replace:
Self.username = os.environ[' username ']
Run again, problem solved
2016-03-30 08:33:00 Info Log location:/tmp/pgy_log//20160330
2016-03-30 08:33:00 info log location:/tmp/pgy_log//20160330
info:20160328: Log location:/tmp/pgy_log//20160330
2016-03-01
2016-03-31
14