Skip to content

AttributeError with virtualenv version 20.33.1: 'PythonInfo' object has no attribute 'tcl_lib' #10504

@douwevandermeij

Description

@douwevandermeij

Description

AttributeError

  'PythonInfo' object has no attribute 'tcl_lib'

  at /opt/hostedtoolcache/Python/3.12.11/x64/lib/python3.12/site-packages/virtualenv/activation/via_template.py:50 in replacements
       46│             "__VIRTUAL_ENV__": str(creator.dest),
       47│             "__VIRTUAL_NAME__": creator.env_name,
       48│             "__BIN_NAME__": str(creator.bin_dir.relative_to(creator.dest)),
       49│             "__PATH_SEP__": os.pathsep,
    →  50│             "__TCL_LIBRARY__": creator.interpreter.tcl_lib or "",
       51│             "__TK_LIBRARY__": creator.interpreter.tk_lib or "",
       52│         }
       53│ 
       54│     def _generate(self, replacements, templates, to_folder, creator):
  • OS: Ubuntu
  • Shell: GitHub Actions
  • Python version and path: 3.12.11

Here is an example project/run that fails: https://github.com/douwevandermeij/test-virtualenv/actions/runs/16797823289/job/47572059324

Also reported here: pypa/virtualenv#2944 with PR pypa/virtualenv#2945

Workarounds

Downgrade virtualenv to 20.32.0

Poetry Installation Method

pip

Operating System

Ubuntu 24.04.2 LTS

Poetry Version

2.1.4

Poetry Configuration

see github action log

Python Sysconfig

sysconfig.log
Paste the output of 'python -m sysconfig', over this line.

Example pyproject.toml

[tool.poetry]
name = "test-virtualenv"
version = "0.0.1"
description = ""
authors = ["Douwe van der Meij <[email protected]>"]
exclude = []

[tool.poetry.dependencies]
python = "~3.12"
python-dotenv = "*"
fractal-toolkit = "*"
pydantic = "*"
fastapi = "*"
uvicorn = "*"
firebase-admin = "*"
httpx = "*"
sentry-sdk = {version = "*", extras = ["fastapi"]}
python-jose = {version = "*", extras = ["cryptography"]}
python-multipart = "*"
google-cloud-pubsub = "*"
google-cloud-secret-manager = "*"
jinja2 = "*"
requests = "*"
python-dateutil = "*"
jwcrypto = "*"

[tool.poetry.group.dev.dependencies]
autoflake = "*"
black = "*"
flake8 = "*"
isort = "*"
pre-commit = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
pytest-env = "*"
pytest-sugar = "*"

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

see https://github.com/douwevandermeij/test-virtualenv/blob/main/pyproject.toml

Poetry Runtime Logs

poetry-runtime.log
Paste the output of 'poetry -vvv <command>', over this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/external-issueIssue is caused by external project (platform, dep, etc)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions