Skip to content

Commit

Permalink
Add a quick check for MST Store Python install (#5470)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
snejus authored Nov 22, 2024
2 parents 176661b + 1d63bf9 commit ef328ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions beets/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/main.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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``
Expand Down
Binary file modified extra/beets.reg
Binary file not shown.

0 comments on commit ef328ed

Please sign in to comment.