<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_version():
 """Returns the version of formic. This method retrieves the version from VERSION.txt, and it should be exactly the same as the version retrieved from the package manager"""

    try:
        # Try with the package manager, if present
        from pkg_resources import resource_string
        return resource_string(__name__, "VERSION.txt").decode('utf8').strip()
    except Exception:
        # If the package manager is not present, try reading the file
        version = os.path.join(os.path.dirname(__file__), "VERSION.txt")
        with open(version, "r") as f:
            return f.readlines()[0].strip()