← 输入框|github.com|刷新
Skip to content

Windows: venv created with --symlinks does not expose abi3t-compat/python3t.dll #162791

Backlog

Description

@BookWorm0

Bug report

From an elevated cmd.exe prompt, create two venv directories, one with copies of the python binaries and one with symlinks:

C:\tmp\t1>py -m venv --symlinks .venvX
C:\tmp\t1>py -m venv .venvOK

From a regular cmd.exe prompt, populate the .venvOK directory and try the import:
C:\tmp\t1>.venvOK\Scripts\activate
(.venvOK) C:\tmp\t1>python -m pip install cryptography==50.0.2
(.venvOK) C:\tmp\t1>python -c "import cryptography.hazmat.bindings._rust"

That succeeds.

From a regular cmd.exe prompt, populate the .venvX directory and try the import:
C:\tmp\t1>.venvX\Scripts\activate
(.venvX) C:\tmp\t1>python -m pip install cryptography==50.0.2
(.venvX) C:\tmp\t1>python -c "import cryptography.hazmat.bindings._rust"

That fails with the following error output:
Traceback (most recent call last):
File "<string>", line 1, in <module>
import cryptography.hazmat.bindings._rust
ImportError: DLL load failed while importing _rust: The specified module could not be found.

The actual library which is failing for me is pyAesCrypt, but this is smallest repro scenario I could find.

CPython versions tested on:

3.15

Operating systems tested on:

Windows

Activity

  1. added
    type-bug
    on Nov 28, 2026
  2. BookWorm0 commented on Nov 28, 2026

    @BookWorm0
    Author

    Related issues

    This issue appears related to CPython issue
    #148690,
    which concerns Windows DLL compatibility for the new abi3t ABI.

    However, this report describes an additional problem:
    virtual environments created with symlinked executables do not
    make python3t.dll available in the Scripts directory.

    Copying python3t.dll into Scripts\abi3t-compat fixes the problem.

  3. added
    topic-venv
    on Nov 28, 2026
  4. mayooreshmoodanwal commented on Nov 28, 2026

    @mayooreshmoodanwal

    I have read the details of issue #162791 and understand the problem. I plan to implement a solution that ensures the abi3t-compat/python3t.dll is correctly exposed in virtual environments created with the --symlinks option on Windows. This will involve modifying the virtual environment creation process to properly handle symlinks and ensure all necessary DLLs are accessible. I would appreciate the opportunity to work on this issue or be assigned it. Thank you.

  5. added
    stdlib
    on Nov 29, 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

    OS-windowsstdlibtopic-venvtype-bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions