jordansissel/fpm · error · FPM::InvalidPackageConfiguration

The path ('#{path_to_package}') doesn't appear to be a pytho

Error message

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.

What it means

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.

Source

Thrown at lib/fpm/package/python.rb:327

  # Input a package.
  #
  # The 'package' can be any of:
  #
  # * A name of a package on pypi (ie; easy_install some-package)
  # * The path to a directory containing setup.py or pyproject.toml
  # * The path to a setup.py or pyproject.toml
  # * The path to a python sdist file ending in .tar.gz
  # * The path to a python wheel file ending in .whl
  def input(package)
    explore_environment

    path_to_package = download_if_necessary(package, version)

    # Expect a setup.py or pyproject.toml if it's a directory.
    if File.directory?(path_to_package)
      if !(File.exist?(File.join(path_to_package, "setup.py")) or File.exist?(File.join(path_to_package, "pyproject.toml")))
        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."
      end
    end

    if File.file?(path_to_package)
      if ["setup.py", "pyproject.toml"].include?(File.basename(path_to_package))
        path_to_package = File.dirname(path_to_package)
      end
    end

    if [".tar.gz", ".tgz"].any? { |suffix| path_to_package.end_with?(suffix) }
      # Have pip convert the .tar.gz (source dist?) into a wheel
      logger.debug("Found tarball and assuming it's a python source package.")
      safesystem(*attributes[:python_pip], "wheel", "--no-deps", "-w", build_path, path_to_package)

      path_to_package = ::Dir.glob(build_path("*.whl")).first
      if path_to_package.nil?
        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."
      end

View on GitHub (pinned to b6d77ba72a)

When it happens

Trigger: Thrown at lib/fpm/package/python.rb:327 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of jordansissel/fpm@b6d77ba72a (2026-08-21). Data as JSON: /api/errors/c986e8aa429dcfc3. Report an issue: GitHub.