You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to figure out available Python versions, thx attempts to run python3 -V which on Windows generally resolves to %LocalAppData%\Microsoft\WindowsApps\python3.EXE -V, which is not a python interpreter unfortunately (it brings up the Microsoft Store window pointed to the Python "App" when run without args).
This results in the following warning on every thx invocation:
WARNING context:59: running `C:\Users\zsolz\AppData\Local\Microsoft\WindowsApps\python3.EXE -V` gave unexpected version string: ''
Instead of thx trying to figure out all the available python installations, maybe it's worth delegating this task to the py launcher:
> py --help
Python Launcher for Windows Version 3.10.150.1013
usage:
C:\windows\py.exe [launcher-args] [python-args] [script [script-args]]
Launcher arguments:
-2 : Launch the latest Python 2.x version
-3 : Launch the latest Python 3.x version
-X.Y : Launch the specified Python version
The above all default to 64 bit if a matching 64 bit python is present.
-X.Y-32: Launch the specified 32bit Python version
-X-32 : Launch the latest 32bit Python X version
-X.Y-64: Launch the specified 64bit Python version
-X-64 : Launch the latest 64bit Python X version
-0 --list : List the available pythons
-0p --list-paths : List with paths
If no script is specified the specified interpreter is opened.
If an exact version is not given, using the latest version can be overridden by
any of the following, (in priority order):
An active virtual environment
A shebang line in the script (if present)
With -2 or -3 flag a matching PY_PYTHON2 or PY_PYTHON3 Environment variable
A PY_PYTHON Environment variable
From [defaults] in py.ini in your %LOCALAPPDATA%\py.ini
From [defaults] in py.ini beside py.exe (use `where py` to locate)
Here's an example output:
> py -0p
Installed Pythons found by C:\windows\py.exe Launcher for Windows
-3.10-64 C:\Users\zsolz\AppData\Local\Programs\Python\Python310\python.exe *
-3.9-64 C:\Users\zsolz\AppData\Local\Programs\Python\Python39\python.exe
Details
OS: Windows
Python version: any
thx version: 0.5.0
Can you repro on main? probably? :)
Can you repro in a clean virtualenv? yes
The text was updated successfully, but these errors were encountered:
Description
While trying to figure out available Python versions,
thx
attempts to runpython3 -V
which on Windows generally resolves to%LocalAppData%\Microsoft\WindowsApps\python3.EXE -V
, which is not a python interpreter unfortunately (it brings up the Microsoft Store window pointed to the Python "App" when run without args).This results in the following warning on every
thx
invocation:Instead of
thx
trying to figure out all the available python installations, maybe it's worth delegating this task to thepy
launcher:Here's an example output:
Details
The text was updated successfully, but these errors were encountered: