Skip to content

poetry run poetry ... fails on Windows #5909

Closed

Description

@johnthagen
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Windows 10

  • Poetry version: 1.1.13

Issue

On Windows, it seems that the path to poetry itself is not accessible within a poetry run invocation from Powershell:

> poetry run poetry --version

  FileNotFoundError

  [WinError 2] The system cannot find the file specified

  at C:\Program Files\Python310\lib\subprocess.py:1435 in _execute_child
      1431│             sys.audit("subprocess.Popen", executable, args, cwd, env)
      1432│
      1433│             # Start the process
      1434│             try:
    → 1435│                 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      1436│                                          # no special security
      1437│                                          None, None,
      1438│                                          int(not close_fds),
      1439│                                          creationflags,

This did not fail for me with the same version of Poetry on macOS.

Activity

  1. changed the title [-]`poetry run poetry ...` fails[/-] [+]`poetry run poetry ...` fails on Windows[/+] on Jun 25, 2022
  2. dimbleby commented on Jun 25, 2022

    @dimbleby
    Contributor

    why would you do poetry run poetry --version and not just poetry --version?

  3. johnthagen commented on Jun 25, 2022

    @johnthagen
    ContributorAuthor

    @dimbleby This was a minimal reproducible example while trying to help debug another issue in which a program was calling poetry through subprocess and it failed on Windows. It seemed like it could be related.

  4. dimbleby commented on Jun 25, 2022

    @dimbleby
    Contributor

    fix at #3339 looks potentially relevant

  5. johnthagen commented on Jun 26, 2022

    @johnthagen
    ContributorAuthor

    On a clean Windows 10 VM with Python 3.10.5, I installed Poetry 1.2.0b2:

    (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - --preview

    And this then works:

    > poetry run poetry --version
    Poetry (version 1.2.0b2)

    Closing this as fixed on latest pre-release.

  6. github-actions commented on Mar 1, 2024

    @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.

  7. locked as resolved and limited conversation to collaborators on Mar 1, 2024
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

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions