[Python] Downloading Python wheels locally - error: subprocess-exited-with-error

Discussão em 'Python' iniciado por Stack, Setembro 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to download all packages from requirements.txt file.

    I ran

    ! pip download -r requirements.txt -d ./wheels --verbose


    It generated error:

    Obtaining bq_helper from git+https://github.com/SohierDane/BigQuery_Helper@8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f#egg=bq_helper (from -r requirements.txt (line 53))
    Running command git config --get-regexp 'remote\..*\.url'
    remote.origin.url https://github.com/SohierDane/BigQuery_Helper
    Running command git rev-parse HEAD
    8615a7f6c1663e7f2d48aa2b32c2dbcb600a440f
    Skipping because already up-to-date.
    Running command python setup.py egg_info
    error: Multiple top-level modules discovered in a flat-layout: ['version', 'bq_helper', 'test_helper'].

    To avoid accidental inclusion of unwanted files or directories,
    setuptools will not proceed with this build.

    If you are trying to create a single distribution with multiple modules
    on purpose, you should not rely on automatic discovery.
    Instead, consider the following options:

    1. set up custom discovery (`find` directive with `include` or `exclude`)
    2. use a `src-layout`
    3. explicitly set `py_modules` or `packages` with a list of names

    To find more information, look for "package discovery" on setuptools docs.
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> See above for output.

    note: This error originates from a subprocess, and is likely not a problem with pip.
    full command: /usr/bin/python3 -c '
    exec(compile('"'"''"'"''"'"'
    # This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
    #
    # - It imports setuptools before invoking setup.py, to enable projects that directly
    # import from `distutils.core` to work with newer packaging standards.
    # - It provides a clear error message when setuptools is not installed.
    # - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
    # setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
    # manifest_maker: standard file '"'"'-c'"'"' not found".
    # - It generates a shim setup.py, for handling setup.cfg-only projects.
    import os, sys, tokenize

    try:
    import setuptools
    except ImportError as error:
    print(
    "ERROR: Can not execute `setup.py` since setuptools is not available in "
    "the build environment.",
    file=sys.stderr,
    )
    sys.exit(1)

    __file__ = %r
    sys.argv[0] = __file__

    if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
    setup_py_code = f.read()
    else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

    exec(compile(setup_py_code, filename, "exec"))
    '"'"''"'"''"'"' % ('"'"'/kaggle/working/src/bq-helper/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' egg_info --egg-base /tmp/pip-pip-egg-info-rgvr237v
    cwd: /kaggle/working/src/bq-helper/
    Preparing metadata (setup.py) ... error
    error: metadata-generation-failed

    × Encountered error while generating package metadata.
    ╰─> See above for output.

    note: This is an issue with the package mentioned above, not pip.
    hint: See above for details.


    Is there way to fix this?

    Here is my requirements.txt file

    Continue reading...

Compartilhe esta Página