Skip to content

Now it works on a uv venv#336

Merged
danielhanchen merged 1 commit into
unslothai:mainfrom
kittawere:main
Oct 22, 2025
Merged

Now it works on a uv venv#336
danielhanchen merged 1 commit into
unslothai:mainfrom
kittawere:main

Conversation

@kittawere

Copy link
Copy Markdown
Contributor

This is my first pull request, I know is not much but is honest work

GGUF AND LLAMA.cpp does not work inside a uv venv

Trying to test unslothai/unsloth#3215 I discovered that when inside a uv venv, the automatic installation of GGUF and llama.cpp overflows into the global system pip env

From what @rolandtannous said on unslothai/unsloth#3487 , python -m venv venv does not work, A conda env works as intended

My fix will allow unsloth to work on a uv venv without conda

Simple as f****

This morning I was doing a lot of stuff to check if the interpreter was inside a venv, if uv was installed etc....

Basically I was trying to check if you were in a venv, in that case check if the venv was created with uv checking pyvenv.cfg and in that case override final_pip on check_pip

But I figure out if on the PIP_OPTIONS I change the order, will try to use uv before the rest, and in the case that it is installed but you are not in a uv venv it should be compatible

Tests

Tested on uv venv and conda env on debian

@danielhanchen

Copy link
Copy Markdown
Member

Ok this is great thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants