Skip to content

poetry show <package> outputs incorrect version when poetry.lock contains multiple version for same package. #8945

Closed

Description

@yuji38kwmt
  • Poetry version: 1.7.1
  • Python version: 3.12.1
  • OS version and name: Ubuntu 22.04
  • pyproject.toml: Refer to the following
  • 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

I am developing the python tool which supports python version from 3.8 to 3.12.
The tool requires numpy.

I written the bellow pyproject.toml, and I execute poetry install command in python 3.12.

[tool.poetry]
name = "install-test-312"
version = "0.1.0"
description = ""
authors = ["yuji38kwmt"]
readme = "README.md"
packages = [{include = "install_test_312"}]

[tool.poetry.dependencies]
python = "^3.8"
numpy = [
  {version = ">=1.26", python = ">=3.9"},
  {version = "<1.25", python = "=3.8"}
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

I expected that numpy 1.26.3 was installed.
Actually numpy 1.26.3 was installed.

$ poetry run python -c "import numpy; print(numpy.__version__);"

1.26.3

poetry show command also outputs numpy 1.26.3.

$ poetry show 
numpy 1.26.3 Fundamental package for array computing in Python

But poetry show numpy command outputs numpy 1.24.4

$ poetry show numpy 
 name         : numpy                                             
 version      : 1.24.4                                            
 description  : Fundamental package for array computing in Python 

I think that poetry show numpy command affects python environment.

Activity

  1. added
    kind/bug
    status/triage
    on Feb 5, 2024
  2. dimbleby commented on Feb 5, 2024

    @dimbleby
    Contributor

    code is here, please submit a merge request if you have improvements

  3. added
    area/ux
    and removed
    status/triage
    on Jul 31, 2024
  4. added
    area/show
    on Oct 10, 2024
  5. github-actions commented on Oct 19, 2026

    @github-actions

    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.

  6. locked as resolved and limited conversation to collaborators on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/showarea/uxkind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions