@@ -207,298 +207,176 @@ Get Zephyr and install Python dependencies
207
207
208
208
Next, clone Zephyr and its :ref: `modules <modules >` into a new :ref: `west
209
209
<west>` workspace named :file: `zephyrproject `. You'll also install Zephyr's
210
- additional Python dependencies.
210
+ additional Python dependencies in a ` Python virtual environment `_ .
211
211
212
-
213
- .. note ::
214
-
215
- It is easy to run into Python package incompatibilities when installing
216
- dependencies at a system or user level. This situation can happen,
217
- for example, if working on multiple Zephyr versions or other projects
218
- using Python on the same machine.
219
-
220
- For this reason it is suggested to use `Python virtual environments `_.
221
-
222
- .. _Python virtual environments : https://docs.python.org/3/library/venv.html
212
+ .. _Python virtual environment : https://docs.python.org/3/library/venv.html
223
213
224
214
.. tabs ::
225
215
226
216
.. group-tab :: Ubuntu
227
217
228
- .. tabs ::
229
-
230
- .. group-tab :: Install within virtual environment
231
-
232
- #. Use ``apt `` to install Python ``venv `` package:
233
-
234
- .. code-block :: bash
235
-
236
- sudo apt install python3-venv
237
-
238
- #. Create a new virtual environment:
239
-
240
- .. code-block :: bash
241
-
242
- python3 -m venv ~ /zephyrproject/.venv
243
-
244
- #. Activate the virtual environment:
245
-
246
- .. code-block :: bash
247
-
248
- source ~ /zephyrproject/.venv/bin/activate
249
-
250
- Once activated your shell will be prefixed with ``(.venv) ``. The
251
- virtual environment can be deactivated at any time by running
252
- ``deactivate ``.
253
-
254
- .. note ::
255
-
256
- Remember to activate the virtual environment every time you
257
- start working.
218
+ #. Use ``apt `` to install Python ``venv `` package:
258
219
259
- #. Install west:
260
-
261
- .. code-block :: bash
262
-
263
- pip install west
220
+ .. code-block :: bash
264
221
265
- #. Get the Zephyr source code:
222
+ sudo apt install python3-venv
266
223
267
- .. code-block :: bash
224
+ #. Create a new virtual environment:
268
225
269
- west init ~ /zephyrproject
270
- cd ~ /zephyrproject
271
- west update
226
+ .. code-block :: bash
272
227
273
- #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
274
- automatically load boilerplate code required for building Zephyr
275
- applications.
228
+ python3 -m venv ~ /zephyrproject/.venv
276
229
277
- .. code-block :: bash
230
+ #. Activate the virtual environment:
278
231
279
- west zephyr-export
232
+ .. code-block :: bash
280
233
281
- #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
282
- dependencies. Install them with ``pip ``.
234
+ source ~ /zephyrproject/.venv/bin/activate
283
235
284
- .. code-block :: bash
236
+ Once activated your shell will be prefixed with ``(.venv) ``. The
237
+ virtual environment can be deactivated at any time by running
238
+ ``deactivate ``.
285
239
286
- pip install -r ~ /zephyrproject/zephyr/scripts/requirements.txt
240
+ .. note ::
287
241
288
- .. group-tab :: Install globally
242
+ Remember to activate the virtual environment every time you
243
+ start working.
289
244
290
- #. Install west, and make sure :file: `~/.local/bin ` is on your
291
- :envvar: `PATH ` :ref: `environment variable <env_vars >`:
245
+ #. Install west:
292
246
293
- .. code-block :: bash
247
+ .. code-block :: bash
294
248
295
- pip3 install --user -U west
296
- echo ' export PATH=~/.local/bin:"$PATH"' >> ~ /.bashrc
297
- source ~ /.bashrc
249
+ pip install west
298
250
299
- #. Get the Zephyr source code:
251
+ #. Get the Zephyr source code:
300
252
301
- .. code-block :: bash
253
+ .. code-block :: bash
302
254
303
- west init ~ /zephyrproject
304
- cd ~ /zephyrproject
305
- west update
255
+ west init ~ /zephyrproject
256
+ cd ~ /zephyrproject
257
+ west update
306
258
307
- #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
308
- automatically load boilerplate code required for building Zephyr
309
- applications.
259
+ #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
260
+ automatically load boilerplate code required for building Zephyr
261
+ applications.
310
262
311
- .. code-block :: bash
263
+ .. code-block :: bash
312
264
313
- west zephyr-export
265
+ west zephyr-export
314
266
315
- #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
316
- dependencies. Install them with ``pip3 ``.
267
+ #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
268
+ dependencies. Install them with ``pip ``.
317
269
318
- .. code-block :: bash
270
+ .. code-block :: bash
319
271
320
- pip3 install --user -r ~ /zephyrproject/zephyr/scripts/requirements.txt
272
+ pip install -r ~ /zephyrproject/zephyr/scripts/requirements.txt
321
273
322
274
.. group-tab :: macOS
323
275
324
- .. tabs ::
325
-
326
- .. group-tab :: Install within virtual environment
327
-
328
- #. Create a new virtual environment:
329
-
330
- .. code-block :: bash
331
-
332
- python3 -m venv ~ /zephyrproject/.venv
333
-
334
- #. Activate the virtual environment:
335
-
336
- .. code-block :: bash
337
-
338
- source ~ /zephyrproject/.venv/bin/activate
339
-
340
- Once activated your shell will be prefixed with ``(.venv) ``. The
341
- virtual environment can be deactivated at any time by running
342
- ``deactivate ``.
343
-
344
- .. note ::
276
+ #. Create a new virtual environment:
345
277
346
- Remember to activate the virtual environment every time you
347
- start working.
348
-
349
- #. Install west:
350
-
351
- .. code-block :: bash
352
-
353
- pip install west
354
-
355
- #. Get the Zephyr source code:
356
-
357
- .. code-block :: bash
358
-
359
- west init ~ /zephyrproject
360
- cd ~ /zephyrproject
361
- west update
278
+ .. code-block :: bash
362
279
363
- #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
364
- automatically load boilerplate code required for building Zephyr
365
- applications.
280
+ python3 -m venv ~ /zephyrproject/.venv
366
281
367
- .. code-block :: bash
282
+ #. Activate the virtual environment:
368
283
369
- west zephyr-export
284
+ .. code-block :: bash
370
285
371
- #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
372
- dependencies. Install them with ``pip ``.
286
+ source ~ /zephyrproject/.venv/bin/activate
373
287
374
- .. code-block :: bash
288
+ Once activated your shell will be prefixed with ``(.venv) ``. The
289
+ virtual environment can be deactivated at any time by running
290
+ ``deactivate ``.
375
291
376
- pip install -r ~ /zephyrproject/zephyr/scripts/requirements.txt
292
+ .. note ::
377
293
378
- .. group-tab :: Install globally
294
+ Remember to activate the virtual environment every time you
295
+ start working.
379
296
380
- #. Install west:
297
+ #. Install west:
381
298
382
- .. code-block :: bash
299
+ .. code-block :: bash
383
300
384
- pip3 install -U west
301
+ pip install west
385
302
386
- #. Get the Zephyr source code:
303
+ #. Get the Zephyr source code:
387
304
388
- .. code-block :: bash
305
+ .. code-block :: bash
389
306
390
- west init ~ /zephyrproject
391
- cd ~ /zephyrproject
392
- west update
307
+ west init ~ /zephyrproject
308
+ cd ~ /zephyrproject
309
+ west update
393
310
394
- #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
395
- automatically load boilerplate code required for building Zephyr
396
- applications.
311
+ #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
312
+ automatically load boilerplate code required for building Zephyr
313
+ applications.
397
314
398
- .. code-block :: bash
315
+ .. code-block :: bash
399
316
400
- west zephyr-export
317
+ west zephyr-export
401
318
402
- #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
403
- dependencies. Install them with ``pip3 ``.
319
+ #. Zephyr's ``scripts/requirements.txt `` file declares additional Python
320
+ dependencies. Install them with ``pip ``.
404
321
405
- .. code-block :: bash
322
+ .. code-block :: bash
406
323
407
- pip3 install -r ~ /zephyrproject/zephyr/scripts/requirements.txt
324
+ pip install -r ~ /zephyrproject/zephyr/scripts/requirements.txt
408
325
409
326
.. group-tab :: Windows
410
327
411
- .. tabs ::
412
-
413
- .. group-tab :: Install within virtual environment
414
-
415
- #. Open a ``cmd.exe `` terminal window **as a regular user **
416
-
417
- #. Create a new virtual environment:
418
-
419
- .. code-block :: bat
420
-
421
- cd %HOMEPATH%
422
- python -m venv zephyrproject\.venv
423
-
424
- #. Activate the virtual environment:
328
+ #. Open a ``cmd.exe `` terminal window **as a regular user **
425
329
426
- .. code-block :: bat
330
+ #. Create a new virtual environment:
427
331
428
- zephyrproject\.venv\Scripts\activate.bat
429
-
430
- Once activated your shell will be prefixed with ``(.venv) ``. The
431
- virtual environment can be deactivated at any time by running
432
- ``deactivate ``.
433
-
434
- .. note ::
435
-
436
- Remember to activate the virtual environment every time you
437
- start working.
438
-
439
- #. Install west:
440
-
441
- .. code-block :: bat
442
-
443
- pip install west
444
-
445
- #. Get the Zephyr source code:
446
-
447
- .. code-block :: bat
448
-
449
- west init zephyrproject
450
- cd zephyrproject
451
- west update
452
-
453
- #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
454
- automatically load boilerplate code required for building Zephyr
455
- applications.
456
-
457
- .. code-block :: bat
332
+ .. code-block :: bat
458
333
459
- west zephyr-export
334
+ cd %HOMEPATH%
335
+ python -m venv zephyrproject\.venv
460
336
461
- #. Zephyr's ``scripts\requirements.txt `` file declares additional Python
462
- dependencies. Install them with ``pip ``.
337
+ #. Activate the virtual environment:
463
338
464
- .. code-block :: bat
339
+ .. code-block :: bat
465
340
466
- pip install -r %HOMEPATH% \ zephyrproject\zephyr\scripts\requirements.txt
341
+ zephyrproject\.venv\Scripts\activate.bat
467
342
468
- .. group-tab :: Install globally
343
+ Once activated your shell will be prefixed with ``(.venv) ``. The
344
+ virtual environment can be deactivated at any time by running
345
+ ``deactivate ``.
469
346
470
- #. Open a `` cmd.exe `` terminal window ** as a regular user **
347
+ .. note ::
471
348
472
- #. Install west:
349
+ Remember to activate the virtual environment every time you
350
+ start working.
473
351
474
- .. code-block :: bat
352
+ #. Install west:
475
353
476
- pip3 install -U west
354
+ .. code-block :: bat
477
355
478
- #. Get the Zephyr source code:
356
+ pip install west
479
357
480
- .. code-block :: bat
358
+ #. Get the Zephyr source code:
481
359
482
- cd %HOMEPATH%
483
- west init zephyrproject
484
- cd zephyrproject
485
- west update
360
+ .. code-block :: bat
486
361
487
- #. Export a :ref: ` Zephyr CMake package < cmake_pkg >`. This allows CMake to
488
- automatically load boilerplate code required for building Zephyr
489
- applications.
362
+ west init zephyrproject
363
+ cd zephyrproject
364
+ west update
490
365
491
- .. code-block :: bat
366
+ #. Export a :ref: `Zephyr CMake package <cmake_pkg >`. This allows CMake to
367
+ automatically load boilerplate code required for building Zephyr
368
+ applications.
492
369
493
- west zephyr-export
370
+ .. code-block :: bat
494
371
495
- #. Zephyr's ``scripts\requirements.txt `` file declares additional Python
496
- dependencies. Install them with ``pip3 ``.
372
+ west zephyr-export
497
373
498
- .. code-block :: bat
374
+ #. Zephyr's ``scripts\requirements.txt `` file declares additional Python
375
+ dependencies. Install them with ``pip ``.
499
376
500
- pip3 install -r %HOMEPATH% \zephyrproject\zephyr\scripts\requirements.txt
377
+ .. code-block :: bat
501
378
379
+ pip install -r %HOMEPATH% \zephyrproject\zephyr\scripts\requirements.txt
502
380
503
381
Install the Zephyr SDK
504
382
**********************
0 commit comments