{"record":{"id":"9c010c153cbb07e7","repo":"oraios/serena","slug":"wolframkernel-not-found-please-either-1-set-the","errorCode":null,"errorMessage":"WolframKernel not found. Please either:\n1. Set the {WOLFRAM_PATH_ENV_VAR} environment variable to your Wolfram installation\n2. Add WolframKernel to your system PATH\n3. Configure ls_path in ls_specific_settings.wolfram\n4. Install Wolfram Mathematica (13.0+) or Wolfram Engine (12.1+) from https://www.wolfram.com/","messagePattern":"WolframKernel not found\\. Please either:\n1\\. Set the (.+?) environment variable to your Wolfram installation\n2\\. Add WolframKernel to your system PATH\n3\\. Configure ls_path in ls_specific_settings\\.wolfram\n4\\. Install Wolfram Mathematica \\(13\\.0\\+\\) or Wolfram Engine \\(12\\.1\\+\\) from https://www\\.wolfram\\.com/","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/wolfram_language_server.py","lineNumber":151,"sourceCode":"            \"/usr/local/Wolfram/Mathematica/*/Executables/WolframKernel\",\n            \"/usr/local/Wolfram/WolframEngine/*/Executables/WolframKernel\",\n            \"/opt/Wolfram/Mathematica/*/Executables/WolframKernel\",\n        ]:\n            search_locations.extend(sorted(glob.glob(pattern), reverse=True))\n\n    elif system == \"Windows\":\n        for pattern in [\n            \"C:\\\\Program Files\\\\Wolfram Research\\\\Mathematica\\\\*\\\\WolframKernel.exe\",\n            \"C:\\\\Program Files\\\\Wolfram Research\\\\Wolfram Engine\\\\*\\\\WolframKernel.exe\",\n        ]:\n            search_locations.extend(sorted(glob.glob(pattern), reverse=True))\n\n    for location in search_locations:\n        if os.path.isfile(location) and os.access(location, os.X_OK):\n            log.info(f\"Found WolframKernel at: {location}\")\n            return location\n\n    raise FileNotFoundError(\n        \"WolframKernel not found. Please either:\\n\"\n        f\"1. Set the {WOLFRAM_PATH_ENV_VAR} environment variable to your Wolfram installation\\n\"\n        \"2. Add WolframKernel to your system PATH\\n\"\n        \"3. Configure ls_path in ls_specific_settings.wolfram\\n\"\n        \"4. Install Wolfram Mathematica (13.0+) or Wolfram Engine (12.1+) from https://www.wolfram.com/\"\n    )\n\n\ndef _find_kernel_in_install_dir(install_dir: str) -> str | None:\n    \"\"\"Try to locate WolframKernel within a Wolfram installation directory.\"\"\"\n    system = platform.system()\n\n    if system == \"Darwin\":\n        candidates = [\n            os.path.join(install_dir, \"Contents\", \"MacOS\", \"WolframKernel\"),\n            os.path.join(install_dir, \"MacOS\", \"WolframKernel\"),\n        ]\n    elif system == \"Windows\":","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/wolfram_language_server.py#L133-L169","documentation":"Thrown as FileNotFoundError by _find_wolfram_kernel when no WolframKernel executable can be located. Unlike npm-based servers, the Wolfram integration cannot auto-install the kernel; it searches the env-var path, PATH, and ls_path config, and fails with a checklist of remedies.","triggerScenarios":"Starting the Wolfram language server calls _find_wolfram_kernel (from _get_or_install_core_dependency or _determine_disabled_language_servers); none of the searched locations is an executable file (isfile + X_OK).","commonSituations":"Wolfram/Mathematica not installed at all; Wolfram installed in a nonstandard location (e.g. custom install dir, Homebrew Cask); kernel binary exists but lacks execute permission; env var set to the Wolfram app directory rather than the kernel binary.","solutions":["Set the WOLFRAM_PATH env var (WOLFRAM_PATH_ENV_VAR) to the full path of the WolframKernel executable.","Find the kernel and expose it: e.g. ln -s '/Applications/Mathematica.app/Contents/MacOS/WolframKernel' /usr/local/bin/ or add its dir to PATH.","Set ls_path in ls_specific_settings.wolfram to the kernel executable path.","If no Wolfram product exists, install Wolfram Mathematica 13.0+ or the free Wolfram Engine 12.1+ from https://www.wolfram.com/.","chmod +x the kernel binary if it exists but is not executable."],"exampleFix":"// before\n# WolframKernel not on PATH; server startup fails\n// after\nimport os\nos.environ[\"WOLFRAM_KERNEL_PATH\"] = \"/Applications/Mathematica.app/Contents/MacOS/WolframKernel\"  # then construct the server","handlingStrategy":"fallback","validationCode":"import os, shutil\ndef find_wolfram_kernel() -> str | None:\n    p = os.environ.get(\"WOLFRAM_KERNEL_PATH\") or shutil.which(\"WolframKernel\")\n    if p and os.path.isfile(p) and os.access(p, os.X_OK):\n        return p\n    return None\nif find_wolfram_kernel() is None:\n    raise SystemExit(\"Install Wolfram or set WOLFRAM_KERNEL_PATH before starting the server\")","typeGuard":"def is_wolfram_kernel(path: str | None) -> bool:\n    return bool(path) and os.path.isfile(path) and os.access(path, os.X_OK)","tryCatchPattern":"try:\n    ls = SolidLSP(\"wolfram\", repo_path)\nexcept FileNotFoundError as e:\n    if \"WolframKernel not found\" in str(e):\n        # skip Wolfram indexing or guide the user through installation\n        log.warning(\"Wolfram analysis disabled: %s\", e)\n    else:\n        raise","preventionTips":["Set the WOLFRAM_PATH env var or ls_specific_settings.wolfram.ls_path explicitly in every environment.","Verify `WolframKernel` is resolvable via shutil.which() before constructing the server.","Ensure the kernel binary has execute permission (chmod +x).","Use the free Wolfram Engine in CI if Mathematica licensing is unavailable."],"tags":["installation","wolfram","missing-dependency","path"],"backgroundTag":"missing-executable-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}