Skip to content

Fix mlx.launch --python: flag is parsed but never forwarded to the launch script - #4002

Merged
zcbenz merged 2 commits into
ml-explore:mainfrom
jonathan308:fix/launch-python-flag
Aug 6, 2026
Merged

Fix mlx.launch --python: flag is parsed but never forwarded to the launch script#4002
zcbenz merged 2 commits into
ml-explore:mainfrom
jonathan308:fix/launch-python-flag

Conversation

@jonathan308

Copy link
Copy Markdown
Contributor

Proposed changes

mlx.launch --python is documented and parsed, but has no effect: #3536 removed automatic interpreter prepending and added the flag for users who still need it, but RemoteProcess never forwards it to make_launch_script, so the launched command always runs without an interpreter prefix on the remote side.

This threads the flag through RemoteProcessmake_launch_script. The no-prepend default from #3536 is unchanged; an explicit --python is now honored.

Checklist

  • I have read the CONTRIBUTING document
  • I have run black/isort on the touched Python files (clean; no C++ touched)
  • I have added tests (python/tests/test_launch.py) covering the default no-prepend path, an explicit --python, and interpreter-path handling

@zcbenz zcbenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

jonathan308 and others added 2 commits August 6, 2026 09:53
Since ml-explore#3536 removed automatic interpreter prepending, the --python flag
(help: 'Use this python on the remote hosts') has been accepted and
silently ignored: RemoteProcess receives the python argument but never
passes it to make_launch_script, so the launched command is always
exec'd verbatim.

Keep the no-automatic-prepending default, but honor the flag when it is
explicitly provided by prepending the requested interpreter to the
command. --print-python still reports sys.executable when the flag is
unset.
@zcbenz
zcbenz force-pushed the fix/launch-python-flag branch from d2a1857 to 4965266 Compare August 6, 2026 00:54
@zcbenz
zcbenz merged commit eac436b into ml-explore:main Aug 6, 2026
28 checks 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