Python pip - expressing trusted host in command line call - Stack Overflow

admin2025-04-15  1

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?

转载请注明原文地址:http://www.anycun.com/QandA/1744716362a86632.html