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.
This commit is contained in:
Šarūnas Nejus 2024-11-22 13:46:09 +00:00 committed by GitHub
commit ef328ed740
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 14 additions and 1 deletions

View file

@ -1858,6 +1858,14 @@ def main(args=None):
"""Run the main command-line interface for beets. Includes top-level
exception handlers that print friendly error messages.
"""
if "AppData\\Local\\Microsoft\\WindowsApps" in sys.exec_prefix:
log.error(
"error: beets is unable to use the Microsoft Store version of "
"Python. Please install Python from https://python.org.\n"
"error: More details can be found here "
"https://beets.readthedocs.io/en/stable/guides/main.html"
)
sys.exit(1)
try:
_raw_main(args)
except UserError as exc:

View file

@ -13,6 +13,11 @@ New features:
many different artists at once.
Bug fixes:
* Check if running python from the Microsoft Store and provide feedback to install
from python.org.
:bug:`5467`
For packagers:
Other changes:

View file

@ -109,7 +109,7 @@ get it right:
should open the "System Properties" screen, then select the "Advanced" tab,
then hit the "Environmental Variables..." button, and then look for the PATH
variable in the table. Add the following to the end of the variable's value:
``;C:\Python37;C:\Python37\Scripts``. You may need to adjust these paths to
``;C:\Python38;C:\Python38\Scripts``. You may need to adjust these paths to
point to your Python installation.
3. Now install beets by running: ``pip install beets``

Binary file not shown.