OverflowError: Python int too large to convert to C long

I was able to setup my raspberry pi using Method 1 mentioned here.

Below is my simple code. Just trying to create instance of rvr using SpheroRvrObserver()

import os
import sys
import time
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../')))

from sphero_sdk import Colors
from sphero_sdk import SpheroRvrObserver

rvr = SpheroRvrObserver()

After running program I am getting below error

(sphero-sdk-raspberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/getting_started/observer/leds $ (sphero-son a.pyberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/getting_started/observer/leds $ sudo pyth
Traceback (most recent call last):
  File "a.py", line 6, in <module>
    from sphero_sdk import Colors
  File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/__init__.py", line 20, in <module>
    from sphero_sdk.common.enums.sensor_enums import MotorIndexesEnum as SensorMotorIndexesEnum
  File "/home/pi/sphero-sdk-raspberrypi-python/sphero_sdk/common/enums/sensor_enums.py", line 83, in <module>
    class InfraredSensorLocationsBitmask(IntEnum):
  File "/usr/lib/python2.7/dist-packages/enum/__init__.py", line 230, in __new__
    enum_member = __new__(enum_class, *args)
OverflowError: Python int too large to convert to C long
(sphero-sdk-raspberrypi-python) pi@raspberrypi:~/sphero-sdk-raspberrypi-python/getting_started/observer/leds $

python version is 3.7.3

Am I missing anything?

1 Like

Hi @hshelar,

You shouldn’t need to use sudo to run python scripts. Maybe that’s causing an issue?


1 Like
SPHERO Email Marketing -