GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `python3.15 -m venv venv315` crashes with a KeyError · Issue #149845 · python/cpython

python3.15 -m venv venv315 crashes with a KeyError #149845

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
python3.15 -m venv venv315 crashes with a KeyError#149845
Copy link
Labels
topic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@bblommers
bblommers
opened on May 14, 2026
Issue body actions

Bug report

Bug description:

Invoking the venv module results in a KeyError:

Error in import line from /usr/lib/python3/dist-packages/ruamel.yaml-0.17.16-nspkg.pth: import sys, types, os;has_mfs = sys.version_info > (3, 5);p = os.path.join(sys._getframe(1).f_locals['sitedir'], *('ruamel',));importlib = has_mfs and __import__('importlib.util');has_mfs and __import__('importlib.machinery');m = has_mfs and sys.modules.setdefault('ruamel', importlib.util.module_from_spec(importlib.machinery.PathFinder.find_spec('ruamel', [os.path.dirname(p)])));m = m or sys.modules.setdefault('ruamel', types.ModuleType('ruamel'));mp = (m or []) and m.__dict__.setdefault('__path__',[]);(p not in mp) and mp.append(p)
  Traceback (most recent call last):
    File "<frozen site>", line 325, in _exec_imports
    File "<string>", line 1, in <module>
  KeyError: "local variable ''sitedir'' is not defined"

OS details

Distributor ID: Ubuntu
Description: Ubuntu 22.04.5 LTS
Release: 22.04
Codename: jammy

Python details

Clean installation using sudo apt install python3.15 python3.15-dev python3.15-venv.

Version: Python 3.15.0b1

CPython versions tested on:

3.15

Operating systems tested on:

Linux

Activity

  1. bblommers
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on May 14, 2026
  2. tomasr8
    added
    topic-venvRelated to the venv moduleRelated to the venv module
    on May 14, 2026
  3. hugovk commented on May 14, 2026

    @hugovk
    hugovk
    on May 14, 2026
    Member
    More actions

    When you say crash, does it fail to create the venv315 dir, or does it create it despite the error message?


    Looks like a duplicate of #149671.

    ruamel.yaml 0.17.16 is from 2021:

    • https://pypi.org/project/ruamel.yaml/0.17.16/

    And contains an old *py3.9-nspkg.pth file:

    • https://inspector.pypi.io/project/ruamel-yaml/0.17.16/packages/d3/cc/248dfb697bb98152c187ced584e505124ed952529d7f8e74b28f6f4d6f31/ruamel.yaml-0.17.16-py3-none-any.whl/

    The latest 0.19.1 is from this year:

    • https://pypi.org/project/ruamel.yaml/0.19.1/

    And the wheel no longer contains that legacy file:

    • https://inspector.pypi.io/project/ruamel-yaml/0.19.1/packages/b8/0c/51f6841f1d84f404f92463fc2b1ba0da357ca1e3db6b7fbda26956c3b82a/ruamel_yaml-0.19.1-py3-none-any.whl/
  4. bblommers commented on May 14, 2026

    @bblommers
    bblommers
    on May 14, 2026
    Author
    More actions

    Hi @hugovk!

    You're right, the venv is created despite the error, and (from what I can tell) everything works as it should. I can source it as normal and install dependencies.

    I did notice the other issue - but I wasn't sure whether it was actually the same root cause. Happy to close this if you think it is a straight duplicate!

  5. hugovk commented on May 14, 2026

    @hugovk
    hugovk
    on May 14, 2026
    Member
    More actions

    Yes, let's close as duplicate. Thanks for the report, it helps to see other occurrences.

    Reacted by Bert Blommers
  6. hugovk
    closed this as a duplicateof PEP 829: KeyError: "local variable ''sitedir'' is not defined" #149671 on May 14, 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

    topic-venvRelated to the venv moduleRelated to the venv moduletype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.