Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry install fails due to the new pip --isolated change which ignores private repos set by PIP_INDEX_URL #7483

Closed
4 tasks done
molatif-dev opened this issue Feb 7, 2023 · 3 comments
Labels
status/duplicate Duplicate issues

Comments

@molatif-dev
Copy link

  • Poetry version: Poetry (version 1.3.2)
  • Python version: Python: 3.10.8
  • OS version and name: macOS 12.6.2
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

After upgrading to Poetry 1.3.x, started getting pip exception while installing mysqlclient-2.1.1.tar.gz as it tries to connect to pypi.org which is blocked in my local env. After troubleshooting this, I noticed that pip ignores PIP_INDEX_URL env param, which is set to local Artifactory repo. This seems related to the change done in #6521 to force --isolated while running pip install.
Exception details for reference:

Command ['/Users/abc/.venv/bin/python', '-m', 'pip', 'install', '--use-pep517', '--disable-pip-version-check', '--isolated', '--no-input', '--prefix', '/Users/abc/.venv', '--no-deps', '/Users/abc/Library/Caches/pypoetry/artifacts/47/f8/c6/4d1cbcf22589ed1f83ad67480a14c2439fe3ce0150972c186091983ff7/mysqlclient-2.1.1.tar.gz'] errored with the following return code 1, and output:
Processing /Users/abc/Library/Caches/pypoetry/artifacts/47/f8/c6/4d1cbcf22589ed1f83ad67480a14c2439fe3ce0150972c186091983ff7/mysqlclient-2.1.1.tar.gz
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/setuptools/
      WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))': /simple/setuptools/
      Could not fetch URL https://pypi.org/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)'))) - skipping
      ERROR: Could not find a version that satisfies the requirement setuptools>=40.8.0 (from versions: none)
      ERROR: No matching distribution found for setuptools>=40.8.0
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

I verified the install works if I run the same pip install command from above without --isolation and it connects to local Artifactory instead of reaching out to pypi.org.
Is it possible to add a parameter to poetry install to avoid pip isolation if needed, for example poetry install --no-pip-isolation

@molatif-dev molatif-dev added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 7, 2023
@neersighted
Copy link
Member

Duplicate #3249.

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2023
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 7, 2023
@MichaelIshri
Copy link

We're suddenly running into this issue now too via Artifactory also.

Seems to be quite a tricky one to troubleshoot because it's not clear to me what is actually trying to hit pypi. Is pip just ignoring the configured index (ours is via pip.ini) or is it Poetry?

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants