Skip to content

Commit 2415045

Browse files
Update Python environment setup instructions and configuration
1 parent 4ac0b47 commit 2415045

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@
1818
},
1919
"plantuml.java": "C:\\Program Files\\OpenJDK\\jdk-22.0.2\\bin\\java.exe",
2020
"plantuml.diagramsRoot": "diagrams/src",
21-
"plantuml.exportOutDir": "diagrams/out"
21+
"plantuml.exportOutDir": "diagrams/out",
22+
"python.defaultInterpreterPath": "./venv/bin/python"
2223
}

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ These prerequisites apply broadly across all infrastructure and samples. If ther
3434
Run through the following steps to create a Python virtual environment before doing anything else:
3535

3636
1. Open VS Code.
37-
1. Invoke the _Command Palette_ via the _View_ menu or a shortcut (on Windows: Ctrl + Shift + P).
37+
1. Invoke the _Command Palette_ via the _View_ menu or a shortcut (on Windows: Ctrl + Shift + P, on Mac: CMD + Shift + P).
3838
1. Select _Python: Create Environment_.
3939
1. Select _Venv_ as we want a local virtual environment.
4040
1. Select the desired, installed Python version.
4141
1. Check _requirements.txt_ to install the Python dependencies we need for this repo, then press _OK_. The install may take a few minutes. You can check on progress in the _OUTPUT_ window.
4242
1. Verify the virtual environment is set up. You should see a new _.venv_ directory with a _pyveng.cfg_ file and the Python version you selected earlier.
4343
1. Setup project environment: Run `python setup/setup_python_path.py --generate-env` to configure the Python path.
44+
a. If for some reason the `python` command is not found, please try adding your virtual environment's `bin` or `Scripts` directory to your system's PATH variable. An example command to do this for a virtual environment named `venv` would be to run `source .venv/bin/activate`
4445

4546
The first time you run a Jupyter notebook, you'll be asked to install the Jupyter kernel package (ipykernel).
4647

setup/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ Configures cross-platform PYTHONPATH for APIM Samples.
88
python setup/setup_python_path.py --generate-env
99
```
1010

11-
This script auto-detects the project root and generates a `.env` file that VS Code uses for Python path configuration.
11+
This script auto-detects the project root and generates a `.env` file that VS Code uses for Python path configuration. If for some reason the `python` command is not found, please try adding your virtual environment's `bin` or `Scripts` directory to your system's PATH variable. An example command to do this for a virtual environment named `venv` is:
12+
13+
```shell
14+
source .venv/bin/activate
15+
```

0 commit comments

Comments
 (0)