Skip to content

--extra-pip-args doesn't pick up --platform option for pip correclty. #6001

@ChannyClaus

Description

@ChannyClaus

Issue description

--platform flag (along with --no-deps and --target) from pip doesn't seem to get picked up correctly by pipenv via --extra-pip-args.

Expected result

The installation should succeed since pip install does with those flags:

$ pip install --platform=macosx_10_14_x86_64 --no-deps --target $(pipenv --venv)/lib/python3.8/site-packages/ tensorflow~=2.8.0
Collecting tensorflow~=2.8.0
  Using cached tensorflow-2.8.4-cp38-cp38-macosx_10_14_x86_64.whl (217.9 MB)
Installing collected packages: tensorflow
Successfully installed tensorflow-2.8.4
WARNING: Target directory /Users/chan.kang/.local/share/virtualenvs/tensorflow-4pbUTlUx/lib/python3.8/site-packages/tensorflow-2.8.4.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory /Users/chan.kang/.local/share/virtualenvs/tensorflow-4pbUTlUx/lib/python3.8/site-packages/tensorflow already exists. Specify --upgrade to force replacement.
WARNING: Target directory /Users/chan.kang/.local/share/virtualenvs/tensorflow-4pbUTlUx/lib/python3.8/site-packages/bin already exists. Specify --upgrade to force replacement.

[notice] A new release of pip is available: 23.0.1 -> 23.3.1
[notice] To update, run: python3.8 -m pip install --upgrade pip

Actual result

$ pipenv install --verbose --extra-pip-args "--platform=macosx_10_14_x86_64 --no-deps --target $(pipenv --venv)/lib/python3.8/site-packages/"  tensorflow~=2.8.0
Installing tensorflow~=2.8.0...
Resolving tensorflow~=2.8.0...
Added tensorflow to Pipfile's [packages] ...
✔ Installation Succeeded
Pipfile.lock (db4242) out of date, updating to (904453)...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.star
ting()
INFO:pipenv.patched.pip._internal.resolution.resolvelib.reporter:Reporter.addi
ng_requirement(SpecifierRequirement('tensorflow~=2.8.0'), None)
CRITICAL:pipenv.patched.pip._internal.resolution.resolvelib.factory:Could not 
find a version that satisfies the requirement tensorflow~=2.8.0 (from 
versions: 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1)
Traceback (most recent call last):
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/
resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/
resolvers.py", line 174, in _add_to_criteria
    raise RequirementsConflicted(criterion)
pipenv.patched.pip._vendor.resolvelib.resolvers.RequirementsConflicted: 
Requirements conflict: SpecifierRequirement('tensorflow~=2.8.0')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolutio
n/resolvelib/resolver.py", line 95, in resolve
    result = self._result = resolver.resolve(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/
resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_vendor/resolvelib/
resolvers.py", line 399, in resolve
    raise ResolutionImpossible(e.criterion.information)
pipenv.patched.pip._vendor.resolvelib.resolvers.ResolutionImpossible: 
[RequirementInformation(requirement=SpecifierRequirement('tensorflow~=2.8.0'),
parent=None)]
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 440, 
in resolve
    results = resolver.resolve(constraints, check_supported_wheels=False)
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/patched/pip/_internal/resolutio
n/resolvelib/resolver.py", line 104, in resolve
    raise error from e
pipenv.patched.pip._internal.exceptions.DistributionNotFound: No matching 
distribution found for tensorflow~=2.8.0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/resolver.py", line 675, in 
<module>
    main()
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/resolver.py", line 661, in main
    _main(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/resolver.py", line 645, in 
_main
    resolve_packages(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/resolver.py", line 612, in 
resolve_packages
    results, resolver = resolve(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/resolver.py", line 592, in 
resolve
    return resolve_deps(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 908, 
in resolve_deps
    results, hashes, internal_resolver = actually_resolve_deps(
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 681, 
in actually_resolve_deps
    resolver.resolve()
  File 
"/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/V
ersions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 442, 
in resolve
    raise ResolutionFailure(message=str(e))
pipenv.exceptions.ResolutionFailure: [31m[1mERROR[0m: [33mNo matching 
distribution found for tensorflow~=2.8.0[0m
✘ Locking Failed!
⠧ Locking...
Traceback (most recent call last):
  File "/Users/chan.kang/.pyenv/versions/3.8.17/bin/pipenv", line 8, in <module>
    sys.exit(cli())
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/cli/options.py", line 58, in main
    return super().main(*args, **kwargs, windows_expand_args=False)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/cli/command.py", line 209, in install
    do_install(
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/routines/install.py", line 297, in do_install
    raise e
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/routines/install.py", line 281, in do_install
    do_init(
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/routines/install.py", line 648, in do_init
    do_lock(
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/routines/lock.py", line 65, in do_lock
    venv_resolve_deps(
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 849, in venv_resolve_deps
    c = resolve(cmd, st, project=project)
  File "/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv/utils/resolver.py", line 718, in resolve
    raise RuntimeError("Failed to lock Pipfile.lock!")
RuntimeError: Failed to lock Pipfile.lock!

When possible, provide the verbose output (--verbose), especially for locking and dependencies resolving issues.

Steps to replicate

Running the commands in the above snippet in an empty directory is sufficient to reproduce this issue.


$ pipenv --support

Pipenv version: '2023.10.24'

Pipenv location: '/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pipenv'

Python location: '/Users/chan.kang/.pyenv/versions/3.8.17/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8'

OS Name: 'posix'

User pip version: '23.3.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.17',
 'os_name': 'posix',
 'platform_machine': 'arm64',
 'platform_python_implementation': 'CPython',
 'platform_release': '22.6.0',
 'platform_system': 'Darwin',
 'platform_version': 'Darwin Kernel Version 22.6.0: Wed Jul  5 22:21:53 PDT '
                     '2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6020',
 'python_full_version': '3.8.17',
 'python_version': '3.8',
 'sys_platform': 'darwin'}

System environment variables:

  • SHELL
  • LSCOLORS
  • PYENV_HOOK_PATH
  • GITLAB_PYPI_USERNAME
  • PYENV_SHELL
  • BOKEH_SIGN_SESSIONS
  • XPC_FLAGS
  • NVM_INC
  • TERM_PROGRAM_VERSION
  • REACT_APP_RECAPTCHA_SITE_KEY
  • GITLAB_PYPI_PROJECT_ID
  • __CFBundleIdentifier
  • SSH_AUTH_SOCK
  • TERM_SESSION_ID
  • HOMEBREW_PREFIX
  • SF_WAREHOUSE
  • GITLAB_PYPI_PASSWORD
  • PYENV_VERSION
  • PWD
  • LOGNAME
  • STAGE
  • LLVM_CONFIG
  • SF_USERNAME
  • MANPATH
  • RDS_PASSWORD
  • LaunchInstanceID
  • LDFLAGS
  • HOME
  • RDS_DB_NAME
  • LANG
  • SECURITYSESSIONID
  • UNLEASH_INSTANCE_ID
  • SF_ROLE
  • TMPDIR
  • CPPFLAGS
  • CLICOLOR
  • LOCAL_GRAPHQL_DEV
  • SF_DATABASE
  • PYENV_DIR
  • UNLEASH_URL
  • INFOPATH
  • RDS_PORT
  • NVM_DIR
  • RDS_HOSTNAME
  • TERM
  • SF_ACCOUNT
  • GITLAB_READ_PACKAGE_REGISTRY_TOKEN
  • USER
  • HOMEBREW_CELLAR
  • RDS_USERNAME
  • SHLVL
  • NVM_CD_FLAGS
  • HOMEBREW_REPOSITORY
  • SF_PASSWORD
  • XPC_SERVICE_NAME
  • PYENV_ROOT
  • SF_SCHEMA
  • PATH
  • BOKEH_SECRET_KEY
  • NVM_BIN
  • RECAPTCHA_SECRET_KEY
  • BOKEH_PY_LOG_LEVEL
  • OLDPWD
  • TERM_PROGRAM
  • __CF_USER_TEXT_ENCODING
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /Users/chan.kang/.pyenv/versions/3.8.17/bin:/Users/chan.kang/.pyenv/versions/3.8.17/bin:/opt/homebrew/Cellar/pyenv/2.3.23/libexec:/opt/homebrew/Cellar/pyenv/2.3.23/plugins/python-build/bin:/Users/chan.kang/.nvm/versions/node/v18.16.1/bin:/Users/chan.kang/.pyenv/shims:/opt/homebrew/opt/postgresql@15/bin:/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/findutils/libexec/gnubin:/opt/homebrew/opt/libpq/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/chan.kang/.cargo/bin:/Users/chan.kang/.gem/ruby/X.X.0/bin:/usr/local/opt/openjdk/bin:/Users/chan.kang/.local/bin:/opt/homebrew/opt/findutils/libexec/gnubin:/usr/local/bin:/usr/local/opt/grep/libexec/gnubin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin
  • SHELL: /opt/homebrew/Cellar/bash/5.2.15/bin/bash
  • LANG: en_US.UTF-8
  • PWD: /Users/chan.kang/test/tensorflow2

Contents of Pipfile ('/Users/chan.kang/test/tensorflow2/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]

[dev-packages]

[requires]
python_version = "3.8"

Metadata

Metadata

Assignees

Labels

PR: awaiting-reviewThe PR related to this issue is awaiting review by a maintainer.Type: Enhancement 💡This is a feature or enhancement request.triage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions