'ImportError: cannot import name 'VersionInfo'

I am using LaunchDarkly in my repository for flag-related features. Until recently everything was working fine when I started encountering this error while deploying my service: ImportError: cannot import name 'VersionInfo'

The service is getting deployed on an Ubuntu machine. Also to investigate further I had a look at LaunchDarkly python server SDK code: https://github.com/launchdarkly/python-server-sdk - here they are importing VersionInfo from semver in operators.py file. In my service there is no import related to VersionInfo. Also when I had a look at requirements.txt file in Launchdarkly code there was a mention :

semver>=2.10.2,<3.0.0

This I believe would restrict the newer version of semver which is above 3.0.0 to be imported. As Versioninfo is deprecated in 3.0.0 I would be able to understand why its failing but then semver version in LaunchDarkly seems to be below 3.0.0. Also, the python version I am using is 3.6.x.

Any idea or suggestions around this issue would be greatly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source