Opening Python from within linux using Windows Terminal command line arguments causes it to use the Windows installation of python instead of linux's #17283

Open
opened 2026-01-31 05:37:47 +00:00 by claunia · 0 comments
Owner

Originally created by @DiscantX on GitHub (Apr 20, 2022).

Windows Terminal version

1.12.10982.0

Windows build number

10.0.19044.1645

Other Software

python27
python3.10
Ubuntu 20.04.2 LTS

Steps to reproduce

From Ubuntu in Windows Terminal, run the command:

cmd.exe /c "wt.exe" -p "Ubuntu" python pythonpath.py

pythonpath.py

from time import sleep
import sys
print(sys.path)
sleep(60)

Now run the script on its own:

python pythonpath.py

Command line arguments for doing this were found in the Microsoft documentation.

Expected Behavior

When a python script is run from within a linux subsystem, it uses the subsystem's python installation.

image

Actual Behavior

When the same script is run using Windows Terminal command line arguments, it is run using the the windows installation of python, despite correctly opening in a linux terminal.

image

Originally created by @DiscantX on GitHub (Apr 20, 2022). ### Windows Terminal version 1.12.10982.0 ### Windows build number 10.0.19044.1645 ### Other Software python27 python3.10 Ubuntu 20.04.2 LTS ### Steps to reproduce From Ubuntu in Windows Terminal, run the command: `cmd.exe /c "wt.exe" -p "Ubuntu" python pythonpath.py` ### pythonpath.py `from time import sleep` `import sys` `print(sys.path)` `sleep(60)` Now run the script on its own: `python pythonpath.py` Command line arguments for doing this were found in the[ Microsoft documentation](https://docs.microsoft.com/en-us/windows/terminal/command-line-arguments?tabs=linux). ### Expected Behavior When a python script is run from within a linux subsystem, it uses the subsystem's python installation. ![image](https://user-images.githubusercontent.com/22719102/164172235-21387738-56fd-4840-99b5-bcbea7b7dad3.png) ### Actual Behavior When the same script is run using Windows Terminal command line arguments, it is run using the the windows installation of python, despite correctly opening in a linux terminal. ![image](https://user-images.githubusercontent.com/22719102/164171700-fdec9915-c5e0-44f9-892b-928635ef07fc.png)
claunia added the Issue-QuestionNeeds-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 05:37:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17283