-
Notifications
You must be signed in to change notification settings - Fork 928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow creating a python
shim on python install
#6265
Comments
not sure this was the original intention, but if the shim will work the same as uv run (in terms of environment resolution) it would be very useful this will allow simpler integration with IDEs (instead of explicitly providing a venv, they could be pointed to the uv shim that will do the environment resolution) |
This would be very useful, and is also what is missing in uv compared to pyenv. |
Please just 👍 the original post if you want this. If you have commentary on the implementation or behavior of the shim, that's totally welcome but let's keep the noise down for those subscribing to updates.
We don't think we can do this by default because people have specific expectations about |
This would be a great improvement for the entire Python ecosystem user-friendliness. Currently we manage Python projects like this where I work:
Having |
I want to migrate from rye to uv, but the migration is blocked by this issue. |
I am currently using this workaround to expose uv's Pythons to my shell's for dir in $(uv python dir)/*/bin; do PYTHON_PATHS="$dir:$PYTHON_PATHS"; done
export PATH="$PYTHON_PATHS:$PATH" The problem is that there are multiple |
As a workaround, I wrote the following script #!/usr/bin/env bash
set -euo pipefail
SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"
if [[ "${SCRIPT_NAME}" =~ ^python3\.[0-9]+$ ]]; then
PYTHON_VERSION="${SCRIPT_NAME#python}"
else
2>&1 echo "Error: Invalid script name: ${SCRIPT_NAME}"
exit 1
fi
exec uv run --no-project --python "${PYTHON_VERSION}" --python-preference only-managed --no-config python "$@" And I have symlinks
It's not great, but it works. |
My like was 101, so this feature is in high demand. How can we communicate this to developers? |
Checkout #8458 - the functionality is nearly there |
We agree this is important, we're working on it. There's also a prototype at #7677. |
Are there any plans to add PEP 514 support so that the Python executables are discoverable by the Windows |
@weihenglim yes there are plans for that |
This is so great! I have use cases that make needing to type uv run every time I want something to use the uv installed Python problematic. Putting a 'python' executable in $HOME/.local/bin works perfectly for my use cases. Super appreciate the hard work! (In particular we use poetry for managing our python runtime environments and I couldn't get that working with uv run but it works great with the python installed using --preview --default). |
When installing Python, I should be able to opt-in to adding a
python
shim to my PATH.The text was updated successfully, but these errors were encountered: