168 questions
0
votes
1
answer
45
views
How to install locally built package with uv
I am struggling a bit with uv mental model and compatibility with existing tool.
I have a project with a "setup.py", previously using python -m build to run the build. I couldn't find a way ...
0
votes
0
answers
56
views
Local unit testing apache airflow
Cannot Run Apache Airflow Unit Tests: sqlalchemy.exc.OperationalError: unable to open database file
I am attempting to run a single unit test within the Apache Airflow repository (airflow-core/tests/...
Best practices
1
vote
7
replies
72
views
Building a streamlit app that can be run simply with "uvx [package-name]"
I would like to write a python package (let's call it foobarbaz) that would have script (e.g., pointing to foobarbaz:main) which would itself launch/serve a streamlit app. The ultimate goal is to let ...
1
vote
0
answers
65
views
PyTorch installed via uv project shows CPU-only version on Windows with CUDA specification in pyproject.toml
I'm trying to set up a Python project using uv and pyproject.toml on Windows. I want to install the CUDA-enabled PyTorch, but after installing, when I check the version, it shows CPU-only.
Here’s my ...
1
vote
1
answer
120
views
Running a tool with uvx from a private repo using an access token
I want to frequently test a Python application I'm developing with uv, which I publish to a private repository on a GitLab instance. I've generated an access token with read access to the repo and I ...
0
votes
1
answer
76
views
+250
How to replace a Twine upload with uv publish?
We have an internal tool that was distributed simply by users cloning the git repository. The purpose of the tool is to configure newly created virtual machines for later testing our "real" ...
Best practices
0
votes
2
replies
48
views
Packaging a python application that depends on other servers running
I am developing a LangGraph project with uv. It makes use of LangGraph's implementation of the model context protocol to interface with a number of third-party services, among them an interface for ...
1
vote
1
answer
122
views
How to configure uv via pyproject.toml to lock PyTorch (+cu118) to a custom index and prevent uv run from using the CPU-only version?
I am managing a project with uv (v0.9.4) that requires a specific PyTorch CUDA build. The generic installation works, but using uv run causes a package conflict, despite the environment being correct.
...
3
votes
1
answer
168
views
How to set extra index with credentials for uv like pip configuration
Similar to this question, we want to specify an extra package index to be used by uv. However, our package index url contains private information, i.e., user name and token.
Up to now, we used pip to ...
0
votes
0
answers
82
views
How to specify interpreter, platform, and ABI for cross-platform Python wheel installation with uv install?
I am trying to download and install Python wheel packages into a uv virtual environment for a non-native (cross-platform) target environment.
When using pip, I would typically use flags like --...
1
vote
1
answer
111
views
Can uv integrate with e.g. pytorch prebuilt docker env?
So, pytorch requires a rather large bundle of packages. The prebuilt docker pytorch gpu images (https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/running.html) are quite helpful in ...
5
votes
3
answers
330
views
How to build a single-file namespace library with uv?
I have a project structured like this:
<project-root>
├── pyproject.toml
└── src
└── a_namespace
└── a_module.py
With Poetry, I can install and package this project ...
0
votes
1
answer
172
views
issue installing manim on windows
Resolved 38 packages in 1.11s
× Failed to build `pyglm==2.8.2`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit code: 1)
[stdout]
...
2
votes
3
answers
120
views
Problem installing jupyter-book 2 with the uv package manager
I am attempting to create a jupyter book 2.0 (https://next.jupyterbook.org/) project in a virtual envinoment managed by the uv package manager (https://docs.astral.sh/uv/). However, the jupyter book 2....
0
votes
0
answers
104
views
Is the exclude-newer setting in uv sufficient for determinism and reproducibility without a lockfile?
The Python package management tool uv has an exclude-newer setting, documented as follows:
Limit candidate packages to those that were uploaded prior to a given point in time.
Accepts a superset of ...
1
vote
1
answer
240
views
Changing the owner of .venv created by uv inside Docker
I have a Django app build by uv running inside Docker. I mount the local filesystem as a volume in the container using Docker Compose so that edits to the source code locally trigger reloading of the ...
0
votes
0
answers
84
views
UV Docker Cache behaviour issues
I have checked out Docker Caching and the uv docker example. Both of them fail to clarify on the behaviour of the cache directory.
In the local system, I'm able to check and verify that the ...
0
votes
1
answer
233
views
How to use UV workspaces on a docker container
Following the doc on how to use uv with docker, I have the following Dockerfile
FROM nvidia/cuda:12.6.1-base-ubuntu24.04
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /app
ENV ...
0
votes
0
answers
111
views
uv is building projects without a [build-system] definition in the pyproject.toml
The documentation for uv says:
If your project does not include a [build-system] definition in the pyproject.toml, uv will not build it by default.
However:
C:\Users\USERNAME\Downloads>uv init ...
2
votes
0
answers
75
views
Display all compatible versions of a package
The tensorflow-io package drops wheels for Windows after 0.31.0, but only newer versions have wheels for Apple Silicon.
I am using features that still work across versions, so I want to pin the ...
1
vote
1
answer
137
views
What does the uvw command do?
When I install uv though winget, the uv, uvx and uvw aliases get added.
I know that uvx is an alias for uv tool run, but what is uvw an alias for?
0
votes
0
answers
113
views
Override dependency in dev environment
I have a Python project where I develop an external package in parallel.
When it is deployed I would like to point the install to a set version in the git repo, but for development I would like to ...
1
vote
1
answer
256
views
How to prevent uv with a tkinter application giving xcb error
I am using uv to manage my python environments and I am getting a low level error message when I try to run a simple tkinter script
# xxx.py
import tkinter as tk
def main():
root = tk.Tk()
...
0
votes
1
answer
131
views
Successful mypy run interpreted as failure in pre-commit
Given a .pre-commit-config.yaml:
repos:
- repo: local
hooks:
- id: mypy
name: mypy
language: system
entry: uv run mypy
types: [python]
require_serial: true
exclude: scripts/...
4
votes
1
answer
363
views
Add Python package with UV using environment variable
I want to install the streamlink Python package to my corporate environment. For licencing issue, it needs to be:
Built with --no-binary option for streamlink package.
Built using ...
0
votes
0
answers
67
views
Build a wheel for a project that uses setuptools with uv
flash-attention is a project that uses setuptools.
I successfully installed it from source code inside a uv environment on Windows by cloning the git repo and issuing uv pip install . --no-build-...
2
votes
1
answer
303
views
Do I have to copy every workspace member in the Dockerfile to be able to use `uv sync --locked`
I'm currently in the process of migrating an existing codebase in my org to use uv as a package manager. It's a monorepo and having the ability to setup workspaces within a single repo was amazing. I'...
0
votes
2
answers
116
views
Python - Custom package visible but contained functions are not
My System/Setup
Windows 11 (Enterprise)
Running in VS Code
Running Python 3.13 in a .venv/
Using uv (via python -m pip install uv, I cannot download uv via curl on the system I have to use.)
The ...
6
votes
1
answer
356
views
Open source AI: How can I use uv or pip to install the *correct* build of PyTorch (CUDA, CPU, ROCm, etc.)?
My project uses PyTorch and Lightning. Since PyTorch is system dependent, users need to install it manually, based on their platform, using the platform-specific pip command provided by the PyTorch ...
1
vote
1
answer
206
views
release-please not updating uv.lock when creating a new release
We are using uv to manage our Python packages and release-please to create our releases. The workflow that creates the new releases in GitHub currently does not update the version of our package in uv....
0
votes
0
answers
269
views
uv dependency resolution error: "conflicting URLs for package" with pyproject.toml workspace and optional dependencies
I am using uv to manage my dependency. My pyproject.toml looks like
[project]
name = "project_1"
version = "2.3.0"
description = "My Project description."
requires-python ...
1
vote
1
answer
88
views
Python package upgrade with uv behaves as in old version
for an old project I have upgraded jsonschema. For a prototype project I have added jsonschema to check the new functionality with jsonschema Draft7Validators.
uv pip show jsonschema
shows in both ...
0
votes
0
answers
80
views
Autocomplete pdb and .venv
I have the following file 'test.py'
#!/usr/bin/env python3
if __name__ == '__main__':
test: str = "This is a test"
breakpoint()
print(test)
When executing this (no venv) auto-...
-6
votes
1
answer
401
views
Is there an issue with starting a FastAPI backend within Docker using uv run main.py? [closed]
I'm setting up a FastAPI backend with Docker on my machine (will be deployed to Azure later as well) right now.
All examples I have seen including the official uv docker example start the backend like ...
2
votes
0
answers
373
views
UV package manager cannot find my workspace member
I intended to use git submodule to bring my other source code(backend) into my-app. Then I wanted utilize uv's workspace so that it manages the dependencies of both my-app and the backend altogether.
...
1
vote
1
answer
330
views
Error with parsing a .toml - expected operator is the same as what is already written [closed]
I am using readthedocs to create automatically updating documentation for a project in a GitHub repo and have been asked to use uv in the .readthedocs.yaml file instead of pip for installations as ...
5
votes
2
answers
2k
views
How can I install a Python package temporarily with uv without adding it to pyproject.toml?
I’m experimenting with the uv package manager for Python. Sometimes I want to try out a package briefly, but I don’t want to commit it to my project’s dependencies until I know I’ll use it.
In npm, ...
2
votes
1
answer
726
views
uv `required-environments`: only require that some extras build in some environments
cross-posted to the uv issue tracker
As all dependency problems, this one originates from torch.
I need to support cuda 12.4 on x86_64, and cuda 12.8 on arm64. Importantly, pytorch does not provide ...
0
votes
2
answers
743
views
Use ansible-dev-tools with uvx
When installing ansible-dev-tools into venv with
python -m venv .venv
source .venv/bin/activate
pip install ansible-dev-tools
All the provided executables are located at .venv/bin and are executable ...
0
votes
1
answer
1k
views
pip and uv point to ~/.local/bin/ even after activating virtual environment
I'm working on a python project created using uv on a ubuntu system.
I activated virtual environment using
source .venv/bin/activate
which python points to
/home/username/my-project/.venv/bin/python
...
2
votes
1
answer
3k
views
How to uv add git repo with subpackages
I want to use uv to install packages and add dependencies, equivalent to the following pip workflow:
git clone https://github.com/<username>/<repository>.git
cd <repository>
pip ...
2
votes
1
answer
825
views
VSCode devcontainer and UV [closed]
I'm developing using VSCode's devcontainer, and I used pip with a requirements.txt file for a few years with no problems. Works like charm.
I'd like to upgrade to using uv, but I'm encountering a ...
3
votes
1
answer
3k
views
Activate 'uv' environment - 'venv' mismatch
I am trying to set up an environment in Visual Studio Code for a Python project using uv on Ubuntu.
I have tried different sequences of actions, but without success. Here is the latest one:
uv init
uv ...
1
vote
1
answer
600
views
UV Workspaces Module Not Found
This is my directory structure:
myProject
├── pyproject.toml
├── apps
│ └── myApp
│ ├── pyproject.toml
│ └── main.py
└── lib
└── myLib
├── pyproject.toml
├── main.py
...
1
vote
2
answers
848
views
uv one-liner to create new environment in VS Code
I'm trying to find a simple one-line instruction to create a new project and environment using uv so that I can work up python scripts using VS Code's interactive window. This is in Mac OS.
uv init ...
-2
votes
1
answer
540
views
Install local project in editable mode with uv
I have my project and some other-local-project where I want to;
Import other-local-project in project
Changes in other-local-project are immediately reflected in project
project/
pyproject.toml
...
-5
votes
3
answers
6k
views
How to install uv when I already need an virtual environment to install it?
I want to set up a new Python project and use uv for package management. I don't have it installed on my global system, so I can't initialize an virtual env with
uv venv
The only solution I see now ...
4
votes
1
answer
2k
views
uv fails with --locked, even though running without it doesn't change the lock, during Docker build
I am using uv in a python project to manage dependencies. I worte the following dockerfile based on some examples provided by the uv github repo.
# Use a Python image with uv pre-installed
FROM ghcr....
0
votes
1
answer
285
views
marimo switches to global python instead of using uv venv
running marimo with uv as I have done with other projects, but for some reason it switches from the venv created using uv to the global version of python and nothing I do can seem to make it run in uv....
4
votes
2
answers
6k
views
Create project with specific (downgraded) Python version
At work, I am running 3.9.21. At home, I am running Python 3.13.2 on Linux, but also use uv install Python 3.9.21 to be in sync with work.
In my home machine, I created a new project:
uv init --...