{"record":{"id":"cfa748ea6716bead","repo":"jordansissel/fpm","slug":"failed-building-python-package-format-fpm-tried","errorCode":null,"errorMessage":"Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm.","messagePattern":"Failed building python package format - fpm tried to build a python wheel, but didn't find the \\.whl file\\. This might be a bug in fpm\\.","errorType":"exception","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/python.rb","lineNumber":344,"sourceCode":"      if !(File.exist?(File.join(path_to_package, \"setup.py\")) or File.exist?(File.join(path_to_package, \"pyproject.toml\")))\n        raise FPM::InvalidPackageConfiguration, \"The path ('#{path_to_package}') doesn't appear to be a python package directory. I expected either a pyproject.toml or setup.py but found neither.\"\n      end\n    end\n\n    if File.file?(path_to_package)\n      if [\"setup.py\", \"pyproject.toml\"].include?(File.basename(path_to_package))\n        path_to_package = File.dirname(path_to_package)\n      end\n    end\n\n    if [\".tar.gz\", \".tgz\"].any? { |suffix| path_to_package.end_with?(suffix) }\n      # Have pip convert the .tar.gz (source dist?) into a wheel\n      logger.debug(\"Found tarball and assuming it's a python source package.\")\n      safesystem(*attributes[:python_pip], \"wheel\", \"--no-deps\", \"-w\", build_path, path_to_package)\n\n      path_to_package = ::Dir.glob(build_path(\"*.whl\")).first\n      if path_to_package.nil?\n        raise FPM::InvalidPackageConfiguration, \"Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm.\"\n      end\n    elsif File.directory?(path_to_package)\n      logger.debug(\"Found directory and assuming it's a python source package.\")\n      safesystem(*attributes[:python_pip], \"wheel\", \"--no-deps\", \"-w\", build_path, path_to_package)\n\n      if attributes[:python_obey_requirements_txt?]\n        reqtxt = File.join(path_to_package, \"requirements.txt\")\n        @requirements_txt = File.read(reqtxt).split(\"\\n\") if File.file?(reqtxt)\n      end\n\n      path_to_package = ::Dir.glob(build_path(\"*.whl\")).first\n      if path_to_package.nil?\n        raise FPM::InvalidPackageConfiguration, \"Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm.\"\n      end\n\n    end\n\n    load_package_info(path_to_package)","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/python.rb#L326-L362","documentation":"Error \"Failed building python package format - fpm tried to build a python wheel, but didn't find the .whl file. This might be a bug in fpm.\" thrown in jordansissel/fpm.","triggerScenarios":"Thrown at lib/fpm/package/python.rb:344 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}