{"record":{"id":"c986e8aa429dcfc3","repo":"jordansissel/fpm","slug":"the-path-path-to-package-doesn-t-appear-to","errorCode":null,"errorMessage":"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.","messagePattern":"The path \\('#(.+?)'\\) doesn't appear to be a python package directory\\. I expected either a pyproject\\.toml or setup\\.py but found neither\\.","errorType":"exception","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/python.rb","lineNumber":327,"sourceCode":"\n  # Input a package.\n  #\n  # The 'package' can be any of:\n  #\n  # * A name of a package on pypi (ie; easy_install some-package)\n  # * The path to a directory containing setup.py or pyproject.toml\n  # * The path to a setup.py or pyproject.toml\n  # * The path to a python sdist file ending in .tar.gz\n  # * The path to a python wheel file ending in .whl\n  def input(package)\n    explore_environment\n\n    path_to_package = download_if_necessary(package, version)\n\n    # Expect a setup.py or pyproject.toml if it's a directory.\n    if File.directory?(path_to_package)\n      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","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/python.rb#L309-L345","documentation":"Error \"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.\" thrown in jordansissel/fpm.","triggerScenarios":"Thrown at lib/fpm/package/python.rb:327 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"}