[Python] Python pip - expressing trusted host in command line call

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

  1. Stack

    Stack Membro Participativo

    I'm attempting to fetch a dependency and install in user scope, during script execution:

    # PYPI is a global settings dict

    try:
    resp = subprocess.check_call(
    [
    sys.executable, "-m", "pip", "install",
    "--user", "--trusted-host",
    PYPI["trusted_host"], "-i", PYPI["pypi_url"],
    package_name
    ], text=True
    )


    However, I receive:

    no such option: --trusted-host

    I am writing around Esri's ArcGIS python API, and fetching the optional package from a custom pypi endpoint. I'd like to avoid bothering end users with setting up pip.conf/pip.ini files, or create venvs or anything like that - so the question is:

    How do I make a pip call to a custom host and force trust in one command line expression?

    Continue reading...

Compartilhe esta Página