{"record":{"id":"1f4a6307738da166","repo":"PaddlePaddle/PaddleOCR","slug":"filenotfounderror-file-path","errorCode":null,"errorMessage":"FileNotFoundError: {file_path}","messagePattern":"FileNotFoundError: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"paddleocr/_api_client/_http.py","lineNumber":135,"sourceCode":"                timeout=self._timeout,\n            )\n        except requests.Timeout as e:\n            raise RequestTimeoutError(f\"Request timed out: {e}\") from e\n        except requests.ConnectionError as e:\n            raise NetworkError(f\"Connection failed: {e}\") from e\n        _raise_for_response(resp)\n        return _job_id_from_response(resp)\n\n    def submit_file(\n        self,\n        model: str,\n        file_path: str,\n        optional_payload: dict,\n        page_ranges: Optional[str] = None,\n        batch_id: Optional[str] = None,\n    ) -> str:\n        if not os.path.exists(file_path):\n            raise FileNotFoundError(file_path)\n        data = {\n            \"model\": model,\n            \"optionalPayload\": json.dumps(optional_payload),\n        }\n        if page_ranges is not None:\n            data[\"pageRanges\"] = page_ranges\n        if batch_id is not None:\n            data[\"batchId\"] = batch_id\n        try:\n            with open(file_path, \"rb\") as f:\n                resp = self._session.post(\n                    self._jobs_url,\n                    data=data,\n                    files={\"file\": f},\n                    timeout=self._timeout,\n                )\n        except requests.Timeout as e:\n            raise RequestTimeoutError(f\"Request timed out: {e}\") from e","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_api_client/_http.py#L117-L153","documentation":"Error \"FileNotFoundError: {file_path}\" thrown in PaddlePaddle/PaddleOCR.","triggerScenarios":"Raised by submit_file() when the given local file_path does not exist on disk.","commonSituations":"The local file to upload does not exist at the given path. Check for typos, relative-path resolution against the current working directory, and that the file was not moved or deleted.","solutions":["Check that the file path exists and is spelled correctly; use an absolute path to avoid working-directory issues.","Ensure the process has read permission on the file.","Verify you passed file_path (a local file) and not file_url (a remote URL)."],"exampleFix":"import os\npath = os.path.abspath(file_path)\nassert os.path.exists(path), path  # resolve and verify before submitting","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}