Skip to content

Conversation

@minhsueh
Copy link
Contributor

Issue:
The current string comparison sys.version.split(' ')[0] > '3.2' incorrectly evaluates to False for Python 3.11 (since '1' < '2'), causing the script to look for virtualenv instead of using the built-in venv module.

Proposed Change:
Use sys.version_info >= (3, 3) for a correct numerical comparison. This ensures modern Python environments use the native venv module as intended without requiring additional legacy dependencies.

Note:
While installing virtualenv manually can bypass the error, using sys.version_info is more robust to handle version checks in Python.

@alexcjohnson
Copy link
Collaborator

Good catch! We shouldn't need this conditional at all anymore, nothing in the Dash ecosystem these days supports such old Python versions.

@minhsueh
Copy link
Contributor Author

Right, that makes sense. I’ve removed $ pip install virtualenv from the README and now use venv = '{} -m venv venv'.format(sys.executable) as the default.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looking around this repo there are a bunch of other out-of-date elements, like we're still generating a setup.py file rather than pyproject.toml. If you're motivated to continue improving this we'd welcome another PR, but I'll also see if someone at Plotly can give it a look.

@alexcjohnson alexcjohnson merged commit 6f8de2f into plotly:master Feb 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants