File size: 1,340 Bytes
c0f13ae |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# Connecting Poetry Environment with Jupyter Notebook
This guide provides simple steps to connect a Poetry-managed environment to Jupyter Notebook.
## Steps
1. **Activate the Poetry Environment**
First, navigate to your project directory and activate the Poetry shell:
```bash
poetry shell
```
2. **Install Jupyter as a Development Dependency**
If Jupyter is not already installed, add it as a development dependency:
```bash
poetry add --group dev jupyter
```
3. **Register the Poetry Environment as a Jupyter Kernel**
Run this command to make the Poetry environment available as a Jupyter kernel:
```bash
python -m ipykernel install --user --name=llmdataparser-env --display-name "Python (LLMDataParser)"
```
- `--name=llmdataparser-env`: Assigns a name to the kernel.
- `--display-name "Python (LLMDataParser)"`: Sets the display name seen in Jupyter.
4. **Start Jupyter Notebook**
Launch Jupyter Notebook from the Poetry shell:
```bash
jupyter notebook
```
5. **Select the Poetry Kernel in Jupyter**
- Open a notebook in Jupyter.
- Go to "Kernel" > "Change kernel" and select **Python (LLMDataParser)** from the list.
This connects the notebook to your Poetry environment.
---
You’re now set up to use your Poetry environment within Jupyter Notebook!
|