Skip to content
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

Get path to virtual environment for script #11794

Open
isak102 opened this issue Feb 26, 2025 · 3 comments · May be fixed by #11891
Open

Get path to virtual environment for script #11794

isak102 opened this issue Feb 26, 2025 · 3 comments · May be fixed by #11891
Labels
enhancement New feature or improvement to existing functionality

Comments

@isak102
Copy link

isak102 commented Feb 26, 2025

Question

What I am trying to do is to get the path to the virtual environment for a script, so that I can use that virtual environment in my editor (neovim) so I get autocomplete on 3rd party libraries. uv sync --script was recently added in #11361 , and in the output you can see the path to the venv. But I am wondering if there is a command to just get the path to the venv without syncing?

I tried looking around in the docs if this feature is already suppoted but couldn't find anything.

Platform

No response

Version

No response

@isak102 isak102 added the question Asking for clarification or support label Feb 26, 2025
@zanieb
Copy link
Member

zanieb commented Feb 26, 2025

There's not a way to get the path right now.

I'd be supportive of uv python find --script <name>, though I think you'd need to sync first? Maybe there's another interface we could do.

@zanieb zanieb added enhancement New feature or improvement to existing functionality and removed question Asking for clarification or support labels Feb 26, 2025
@isak102
Copy link
Author

isak102 commented Feb 26, 2025

I think uv python find sounds good. Maybe return an error if the environment has not been created? Or maybe create if it it doesn't exist, but that sounds like uv sync.

@InSyncWithFoo InSyncWithFoo linked a pull request Mar 2, 2025 that will close this issue
@zanieb
Copy link
Member

zanieb commented Mar 6, 2025

The "best" solution for this seems like uv sync --script foo.py --dry-run with a (not yet implemented) JSON output format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants