You are not logged in.
Pages: 1
Hi !
So today i was starting to create a virt env for python so I started to use uv to install maturin, which is a tool to integrate rust into python. I do it by this command:
uv tool install maturin
By surprise this tool is installed like a binary in the ~/.local/bin and not in the folder of the project that I'm working on. So i have two questions about this:
Is this correct ? I mean does the binary of maturin in ~/.local/bin is isolated from the rest of the system ? Could it be a potential conflict with pacman while i'm updating my system or something else ?
Why uv installs the tools in ~/.local/bin ? I mean, does this break the isolation principle that a virt env is trying to do ? Is pretty strange TBH, but I imagine there is a good argument of why is the default behavior, which the opposite of pip for example, that just add the packages and everything inside the project folder, in which is the virtual environment placed.
btw I know that uv add is for packages
Last edited by Succulent of your garden (2025-07-14 22:03:18)
Offline
When a tool is installed, its executables are placed in a bin directory in the PATH which allows the tool to be run without uv. If it's not on the PATH, a warning will be displayed and uv tool update-shell can be used to add it to the PATH.
Depending on where ~/.local/bin is present in $PATH it can cause issues.
Using uvx foo or uv tool run foo may be a better option.
Last edited by Lone_Wolf (2025-07-10 09:27:19)
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Online
`uv` is a utility which does a lot of different things. The `uv tool` command is a means of installing python based programs into your local path (complete with their own isolated venv containing their required dependencies). It is exactly equivalent to the legacy `pipx` tool. If you are working on or creating a project and want to create a venv plus install packages into that venv you would use the `uv venv` + `uv pip install` commands which are equivalent to legacy `python -m venv` + `pip install` commands. So `uv tool` is not something a user would use for installing anything in or for a project.
Last edited by bulletmark (2025-07-10 11:47:16)
Offline
Depending on where ~/.local/bin is present in $PATH it can cause issues.
Using uvx foo or uv tool run foo may be a better option.
I used uv tool update-shell which is the suggestion from the same tool when I had the $PATH conflict, that works in my case.
`uv` is a utility which does a lot of different things. The `uv tool` command is a means of installing python based programs into your local path (complete with their own isolated venv containing their required dependencies). It is exactly equivalent to the legacy `pipx` tool. If you are working on or creating a project and want to create a venv plus install packages into that venv you would use the `uv venv` + `uv pip install` commands which are equivalent to legacy `python -m venv` + `pip install` commands. So `uv tool` is not something a user would use for installing anything in or for a project.
I installed maturin as the documentation suggest https://docs.rs/crate/maturin/latest . Maturin is a tool to make the integration of Rust code into python, which I'm trying to do. Not sure if I use "uv pip install maturin" would work well to be honest, I'll make the try someday, but I'm not sure about this is good, since the binary it's outside of the virtual environment. Sure probably I can use the "uv pip install maturin" to get binary inside my virtual environment and omit his commit using .gitignore, but not sure if the binary itself it's gonna work well .
Not less I have doubt if this binary could affect pacman, probably not but not 100% sure to be honest. Also another issue that I'm having is that cargo doesn't get updated by pacman -Syu, only by paru -Sua, which seems strange, since I installed Rust by the arch official repos packages. Nevertheless I'm currently reading the Rust arch wiki to understand better how all works
Offline
'maturin` is just a command line tool you are installing to use. It is independent of any particular venv. Those instructions at https://docs.rs/crate/maturin/latest could be improved. It should probably first state to install `maturin` from your standard packages if available, i.e. on Arch you are best to just `sudo pacman -S maturin`. The note about using `pip` instead of `pipx` is frankly out of date as global installs using `pip` is frowned upon nowadays, particularly on Arch.
Offline
Thanks for the info bulletmark. I get it, but also tried to install maturin in the virt env and also works. But as you said, it seems just like another cli tool. Nevertheless thanks for your comments on the topic
Offline
Pages: 1