jordansissel/fpm · warning

Using deprecated flag: --install-location. Please use --pref

Error message

Using deprecated flag: --install-location. Please use --prefix instead.

What it means

The virtualenv input target's --install-location option is deprecated in favor of the generic --prefix. The handler still expands and returns the path (File.expand_path), so the old flag keeps working, but every use logs this warning. --prefix is the supported way to choose where the virtualenv is installed inside the package.

Source

Thrown at lib/fpm/package/virtualenv.rb:23

require "fpm/package/dir"

# Support for python virtualenv packages.
#
# This supports input, but not output.
#
class FPM::Package::Virtualenv < FPM::Package
  # Flags '--foo' will be accessable  as attributes[:virtualenv_foo]

  option "--pypi", "PYPI_URL",
  "PyPi Server uri for retrieving packages.",
  :default => "https://pypi.python.org/simple"
  option "--package-name-prefix", "PREFIX", "Name to prefix the package " \
  "name with.", :default => "virtualenv"

  option "--install-location", "DIRECTORY", "DEPRECATED: Use --prefix instead." \
    "  Location to which to install the virtualenv by default.",
    :default => "/usr/share/python" do |path|
    logger.warn("Using deprecated flag: --install-location. Please use " \
                  "--prefix instead.")
    File.expand_path(path)
  end

  option "--fix-name", :flag, "Should the target package name be prefixed?",
  :default => true
  option "--other-files-dir", "DIRECTORY", "Optionally, the contents of the " \
  "specified directory may be added to the package. This is useful if the " \
  "virtualenv needs configuration files, etc.", :default => nil
  option "--pypi-extra-url", "PYPI_EXTRA_URL",
    "PyPi extra-index-url for pointing to your priviate PyPi",
    :multivalued => true, :attribute_name => :virtualenv_pypi_extra_index_urls,
    :default => nil

  option "--setup-install", :flag, "After building virtualenv run setup.py install "\
  "useful when building a virtualenv for packages and including their requirements from "\
  "requirements.txt"

View on GitHub (pinned to b6d77ba72a)

Solutions

  1. Replace --install-location with --prefix
  2. Verify the resulting package contents after the swap: --prefix changes the install root, so inspect the deb/rpm file list
  3. Remove the flag entirely if the default location is acceptable

Example fix

# before
fpm -s virtualenv -t deb -n myapp --install-location /opt/myapp flask

# after
fpm -s virtualenv -t deb -n myapp --prefix /opt/myapp flask
Defensive patterns

Strategy: validation

Validate before calling

if grep -rnE -- '--install-location([ =]|$)' build/; then
  echo 'ERROR: use --prefix instead of --install-location' >&2
  exit 1
fi

Prevention

When it happens

Trigger: Running `fpm -s virtualenv -t deb --install-location /opt/venvs/app ...` instead of `--prefix /opt/venvs/app`.

Common situations: Recipes written before --prefix was standardized across fpm targets; scripts hardcoding /usr/share/python-style default locations from older deployments.

Related errors


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