Can you tell us anything
about your left-hand technique that would allow us to give you meaningful feedback? What specific methods have you used to learn proper left-hand technique to ensure a pain-free lifetime of bass playing? Do you have a private instructor who can look at your technique and tell you what you're doing wrong? Are you willing to take Skype lessons with some of the excellent teachers here on Talkbass?
Without knowing anything
about how you play, my guess
is that you are trying to stretch your hands using 1-2-3-4 fingers over 3 frets (common rookie mistake) rather than using the comfortable and relaxed 1-2-4 fingers over 2 frets.
Electric bass, when properly set up and played through a loud-enough amp, should be one of the physically easiest
instruments to play. There should never be any pain or discomfort. Try getting your bass set up with low action by a pro tech, use low-tension strings, turn your amp up, and play with a lighter touch.
Good luck, hope the pain goes away on its own and medical treatment is not necessary!