Skip to content

Commit ef328ed

Browse files
authored
Add a quick check for MST Store Python install (#5470)
Quick fix for #5467. Checks if the path for python is under the windows store folder then error and point the user to the beets [documentation](https://beets.readthedocs.io/en/stable/guides/main.html). Happy for feedback to improve, but thought it best to exit as early as possible.
2 parents 176661b + 1d63bf9 commit ef328ed

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

beets/ui/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,14 @@ def main(args=None):
18581858
"""Run the main command-line interface for beets. Includes top-level
18591859
exception handlers that print friendly error messages.
18601860
"""
1861+
if "AppData\\Local\\Microsoft\\WindowsApps" in sys.exec_prefix:
1862+
log.error(
1863+
"error: beets is unable to use the Microsoft Store version of "
1864+
"Python. Please install Python from https://python.org.\n"
1865+
"error: More details can be found here "
1866+
"https://beets.readthedocs.io/en/stable/guides/main.html"
1867+
)
1868+
sys.exit(1)
18611869
try:
18621870
_raw_main(args)
18631871
except UserError as exc:

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ New features:
1313
many different artists at once.
1414

1515
Bug fixes:
16+
17+
* Check if running python from the Microsoft Store and provide feedback to install
18+
from python.org.
19+
:bug:`5467`
20+
1621
For packagers:
1722

1823
Other changes:

docs/guides/main.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ get it right:
109109
should open the "System Properties" screen, then select the "Advanced" tab,
110110
then hit the "Environmental Variables..." button, and then look for the PATH
111111
variable in the table. Add the following to the end of the variable's value:
112-
``;C:\Python37;C:\Python37\Scripts``. You may need to adjust these paths to
112+
``;C:\Python38;C:\Python38\Scripts``. You may need to adjust these paths to
113113
point to your Python installation.
114114

115115
3. Now install beets by running: ``pip install beets``

extra/beets.reg

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)