{"id":9767,"library":"geode-common","title":"Geode Common Module","description":"geode-common is the foundational Python module for Geode-solutions' licensed computational geometry and meshing libraries. It provides core utilities, license management, and environment initialization for the entire Geode-solutions ecosystem. It is a wrapper around a C++ library using Pybind11. The current version is 33.21.3, with frequent updates aligning with Geode-solutions' development.","status":"active","version":"33.21.3","language":"en","source_language":"en","source_url":"https://github.com/geode-solutions/geode-common","tags":["geometry","meshing","cad","scientific-computing","pybind11"],"install":[{"cmd":"pip install geode-common","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"symbol":"geode_common","correct":"import geode_common"},{"symbol":"set_license","correct":"from geode_common import set_license"},{"symbol":"initialize_geode_solutions","correct":"from geode_common import initialize_geode_solutions"}],"quickstart":{"code":"import os\nimport geode_common\n\n# The Geode-solutions ecosystem typically requires a license key.\n# It's best practice to provide this via an environment variable.\nlicense_key = os.environ.get(\"GEODE_LICENSE_KEY\", \"\")\ngeode_common.set_license(license_key)\n\n# Initialize the Geode-solutions environment, which is mandatory\n# before using any other Geode-solutions modules.\ngeode_common.initialize_geode_solutions()\n\n# You can check the version or other common properties after initialization.\nprint(f\"Geode-solutions common module initialized. Version: {geode_common.VERSION}\")\nprint(f\"Logger enabled: {geode_common.Logger.is_enabled()}\")\n\n# At this point, you would typically import and use other specific\n# Geode-solutions modules (e.g., geode_mesh, geode_implicit).","lang":"python","description":"This quickstart demonstrates how to initialize the geode-common module, set an (optional) license key, and prepare the environment for other Geode-solutions modules. The `initialize_geode_solutions()` call is crucial."},"warnings":[{"fix":"Ensure your Python environment is within the supported range (currently 3.9 <= Python < 3.13). Use a virtual environment to manage Python versions if necessary.","message":"geode-common has strict Python version requirements. It officially supports Python versions 3.9 through 3.12. Attempting to install or run on unsupported Python versions (e.g., 3.8 or 3.13+) will result in installation failures or runtime errors.","severity":"breaking","affected_versions":"All versions"},{"fix":"Always call `geode_common.initialize_geode_solutions()` early in your application's lifecycle, typically right after importing `geode_common` and setting the license.","message":"Calling `geode_common.initialize_geode_solutions()` is mandatory before using any functionality from `geode-common` or any other Geode-solutions module. Forgetting this step will lead to runtime errors.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Obtain a valid Geode-solutions license key and pass it to `geode_common.set_license('YOUR_KEY_HERE')` or provide it via the `GEODE_LICENSE_KEY` environment variable.","message":"Most licensed Geode-solutions modules rely on a valid license key set via `geode_common.set_license()`. While `geode-common` itself might function partially without it, subsequent imports or operations from other Geode-solutions modules will fail.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install geode-common` to install the package. Ensure your virtual environment (if used) is active.","cause":"The geode-common package is not installed in the current Python environment, or the environment is not activated.","error":"ModuleNotFoundError: No module named 'geode_common'"},{"fix":"Add `geode_common.initialize_geode_solutions()` to your code before any other Geode-solutions operations.","cause":"The required initialization function `geode_common.initialize_geode_solutions()` was not called before attempting to use Geode-solutions functionality.","error":"RuntimeError: Geode-solutions has not been initialized. Please call geode_common.initialize_geode_solutions() first."},{"fix":"Ensure you have a correct and current license key. Set it using `geode_common.set_license('YOUR_KEY_HERE')` or via the `GEODE_LICENSE_KEY` environment variable.","cause":"The provided license key is either missing, expired, or invalid for the Geode-solutions modules being used.","error":"RuntimeError: License is not valid."},{"fix":"Switch to a supported Python version (3.9, 3.10, 3.11, or 3.12). Consider using `pyenv` or `conda` to manage multiple Python versions.","cause":"You are attempting to install geode-common on a Python version that is not officially supported.","error":"ERROR: Package 'geode-common' requires Python '>=3.9, <3.13', but you have Python 3.X."}]}