Newly added pikitlib file (in my case led.py) is not correctly deployed to the robot. The new file ends up in the RobotCode/pikitlib subdirectory, but the robotrunner imports the original pikitlib outside of the RobotCode directory. Because that import is cached, the robot.py import does not import the new file (it just uses the cache).
The end result is the following error after deployment:
Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt.th:Started thread connection-notifier-0
Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt:Listening on 1735
Jan 01 23:05:46 raspberrypi python3[2576]: Traceback (most recent call last):
Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 214, in
Jan 01 23:05:46 raspberrypi python3[2576]: m.start()
Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 91, in start
Jan 01 23:05:46 raspberrypi python3[2576]: self.r.robotInit()
Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/RobotCode/pikitlib/robot.py", lin
Jan 01 23:05:46 raspberrypi python3[2576]: self.leds = pikitlib.Led()
Jan 01 23:05:46 raspberrypi python3[2576]: AttributeError: module 'pikitlib' has no attribute 'Led'
I was able to work around this by copying the file from RobotCode/pikitlib to ../pikitlib/pikitlib on the robot after deployment (and then issuing a "sudo service robotrunner restart").
Newly added pikitlib file (in my case led.py) is not correctly deployed to the robot. The new file ends up in the RobotCode/pikitlib subdirectory, but the robotrunner imports the original pikitlib outside of the RobotCode directory. Because that import is cached, the robot.py import does not import the new file (it just uses the cache).
The end result is the following error after deployment:
Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt.th:Started thread connection-notifier-0 Jan 01 23:05:46 raspberrypi python3[2576]: DEBUG:nt:Listening on 1735 Jan 01 23:05:46 raspberrypi python3[2576]: Traceback (most recent call last): Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 214, in
Jan 01 23:05:46 raspberrypi python3[2576]: m.start()
Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/run.py", line 91, in start
Jan 01 23:05:46 raspberrypi python3[2576]: self.r.robotInit()
Jan 01 23:05:46 raspberrypi python3[2576]: File "/home/pi/RobotKitLib/pikitlib/RobotCode/pikitlib/robot.py", lin
Jan 01 23:05:46 raspberrypi python3[2576]: self.leds = pikitlib.Led()
Jan 01 23:05:46 raspberrypi python3[2576]: AttributeError: module 'pikitlib' has no attribute 'Led'
I was able to work around this by copying the file from RobotCode/pikitlib to ../pikitlib/pikitlib on the robot after deployment (and then issuing a "sudo service robotrunner restart").