Skip to content

Commit d1b4767

Browse files
committed
notes on uv+jupyter and uv export
1 parent c97917b commit d1b4767

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

s1_development_environment/deep_learning_software.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ Here are some general installation commands for Pytorch:
153153
[Exercise files](https://github.com/SkafteNicki/dtu_mlops/tree/main/s1_development_environment/exercise_files){ .md-button }
154154
<!-- markdownlint-restore -->
155155

156+
!!! tip "Notebooks and `uv`
157+
158+
If you are using `uv` as your package manager, you may need to restart the Jupyter Notebook kernel after installing
159+
new packages to ensure that the newly installed packages are recognized within the notebook environment.
160+
156161
1. Start a Jupyter Notebook session in your terminal (assuming you are at the root of the course material).
157162
Alternatively, you should be able to open the notebooks directly in your code editor. For VS Code users you can read
158163
more about how to work with Jupyter Notebooks in VS code

s1_development_environment/package_manager.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,19 @@ to make it work.
415415
uv python pin 3.13
416416
```
417417

418-
8. (Optional) `uv` also supports the notion of *tools* which are external command line tools that you may use in
418+
8. Assume you have a friend wonking on the same project as you and they are using `pip` together with good old
419+
`requirements.txt` files. How do you create a `requirements.txt` file from your `uv` project?
420+
421+
??? success "Solution"
422+
423+
Relevant documentation can be found
424+
[here](https://docs.astral.sh/uv/concepts/projects/sync/#exporting-the-lockfile).
425+
426+
```bash
427+
uv export --format requirements.txt
428+
```
429+
430+
9. (Optional) `uv` also supports the notion of *tools* which are external command line tools that you may use in
419431
multiple projects. Examples of such tools are `black`, `ruff`, `pytest` and so on (all which you will encounter
420432
later in the course). These tools can be installed globally on your system by using the `uvx` (or `uv tool`):
421433
command:

0 commit comments

Comments
 (0)