python3
Hack to handle a missing alias/symlink, for example when you're on windows or don't want to be bothered
This exists so that the following Makefile command will execute correctly on Windows.
PLATFORM_ARCH := $(shell python3 -c "import platform; print(platform.machine())")
Installation
To get python3 everywhere and python3 means just some random isolated python3
pipx install python3-alias
To get a known version of python3, install into the system or venv.
pip install python3-alias
Motivation
Yes, I know, one solution is for you to personally purchase a Macbook for everyone in the world. Please include me when you do.
Things that don't work
In git bash, this isn't picked up.
alias python3=python
Link python3 to python in bash
ln -s /c/Users/USER/AppData/Local/Programs/Python/Python312/python /usr/bin/python3
# ln: failed to create symbolic link '/usr/bin/python3': Permission denied
Also adding python3=python to this file didn't work.
nano "/C/Program Files/Git/etc/profile.d/aliases.sh"
Also, a shell file named python3 didn't work.
Installing python from the Microsoft Store might work, I didn't try. I'd rather install from python.org.
Redirecting to a different Python
By default the alias forwards to whichever Python launched it (sys.executable). You can override this
with environment variables, checked in this order:
| Variable | Value | Effect |
|---|---|---|
PYTHON3_ALIAS_VENV |
path to a venv directory | Activates the venv (sets PATH, VIRTUAL_ENV, unsets PYTHONHOME) and runs its python. |
PYTHON3_ALIAS_PYTHON |
full path to a python.exe | Runs that interpreter directly. |
PYTHON3_ALIAS_VERSION |
3.14, 3.7, etc. |
Windows: launches via py -X.Y. POSIX: launches pythonX.Y from PATH. |
The first one set wins. If none are set, the alias behaves as before.
Examples
# Pin a specific interpreter
PYTHON3_ALIAS_PYTHON="C:/Python314/python.exe" python3 -V
# Use the py launcher to pick a version (Windows)
PYTHON3_ALIAS_VERSION=3.14 python3 -V
# Run inside a venv without sourcing its activate script
PYTHON3_ALIAS_VENV=./.venv python3 -m pip list
Limitations
This alias isn't to replace pyenv, asdf or the like.
Metadata
Release files for python3-alias 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python3_alias-1.1.0.tar.gz | 6.8 kB | With provenance | Details for python3_alias-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python3_alias-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for python3_alias-1.1.0-py3-none-any.whl |
Total release size: 12.6 kB
Release files / python3_alias-1.1.0.tar.gz
| Download URL | python3_alias-1.1.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e49b3bbb66e4c3d16e5c64812f8f24bb757a669ac03673d8de5d13653c533131
|
|
BLAKE2b-256 checksum How to use checksums |
ef4c09ca2a60df9bcc4c949e8247de66c5b730e0577faba766e20e5cfc52dc04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logRelease files / python3_alias-1.1.0-py3-none-any.whl
| Download URL | python3_alias-1.1.0-py3-none-any.whl |
|---|---|
| Size | 5.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1173e9dbff7215b746ab9da3e06fe546026f12e191b94f59a34d68957ce8443c
|
|
BLAKE2b-256 checksum How to use checksums |
dbf07578b6e66c33c53a964ac96cae82810266b6e9cdb3f818f9553f2b1750ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logSecurity for python3-alias 1.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for python3_alias-1.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.