PyShortcuts

raw JSON →
1.9.7 verified Mon Apr 27 auth: no python

Create desktop and Start Menu shortcuts for Python scripts on Windows, macOS, and Linux. Current version 1.9.7 (released March 2025). Active development, roughly 2-3 releases per year.

pip install pyshortcuts
error AttributeError: module 'pyshortcuts' has no attribute 'get_desktop'
cause Before version 1.9.3, get_desktop was not exported from the main package; it was in pyshortcuts.utils.
fix
Upgrade to pyshortcuts>=1.9.3 or import from pyshortcuts.utils import get_desktop (deprecated).
error ImportError: No module named 'pyshortcuts'
cause pyshortcuts is not installed, or the virtual environment is not activated.
fix
Run 'pip install pyshortcuts' in the correct environment.
breaking Python 3.10 is now required. Versions 1.9.6+ dropped support for Python 3.9 and earlier. Upgrade your Python environment if using older versions.
fix Use Python 3.10 or newer.
deprecated The 'noexe' argument in make_shortcut is deprecated since 1.9.1. Use 'script' as the full path with no exe.
fix Set script to the full path of the Python script and do not set 'exe'; or use the command-line -x flag.
gotcha On macOS, shortcuts may not open a terminal automatically unless the terminal app is properly configured. Use the -t flag or terminal=True argument to ensure a terminal window appears.
fix Add terminal=True to make_shortcut or use -t on command line.
gotcha When running inside a virtual environment, the executable path may not resolve correctly. Version 1.9.7 removes Path.resolve() to improve virtual environment support. If you experience issues, use the full path to the Python executable explicitly.
fix Upgrade to 1.9.7 or pass the full path to the Python executable.

Creates a desktop shortcut to a Python script.

from pyshortcuts import make_shortcut
from pyshortcuts import get_desktop

script = 'myscript.py'
desktop = get_desktop()
make_shortcut(script, name='MyScript', folder=desktop)
print('Shortcut created on desktop')