Project

General

Profile

DevelopersPython3Environment » History » Version 8

Tony Fuller, 12/15/2022 01:44 AM
fix typo `mpip`

1 1 Dan Smith
# Python 3 Developer Environment Setup
2
3 2 Dan Smith
{{>toc}}
4
5 1 Dan Smith
## Windows
6
7
### Install Python
8
1. Download and install from [python.org](https://www.python.org/downloads/windows/). At the time of this writing, "Python 3.10.8" is recommended. During install note these options:
9
  1. Choose *Add python.exe to PATH*
10
  1. Choose *Disable path length limit*
11
1. In Windows settings, search "Manage app execution aliases" and:
12
  1. Disable *App Installer: python.exe*
13
  1. Disable *App Installer: python3.exe*
14
  1. Disable *App Installer: python3.7.exe*
15
1. Browse in explorer to `%AppData%\Local\Programs\Python\Python310` and copy `python.exe` to `python3.exe`
16
17
### Install Git
18
1. Download and install from [git-scm.org](https://git-scm.com/download/win). During installation take the defaults except for:
19
  1. Configuring the line ending conversions: choose *Checkout as-is, commit Unix-style line endings*
20
21
### Configure Git
22
From a command line:
23
1. `git config --global user.name "FIRST_NAME LAST_NAME"`
24
1. `git config --global user.email "MY_NAME@example.com"`
25 7 Dan Smith
1. Optional, if you want to set an editor: `git config --global core.editor "PATH TO EDITOR"`
26 1 Dan Smith
27
### Clone the chirp git repository (py3 branch)
28
From a command line:
29
```
30
C:\Users\{user}\Documents> git clone https://github.com/kk7ds/chirp
31
C:\Users\{user}\Documents> cd chirp
32
C:\Users\{user}\Documents> git checkout origin/py3 -b py3
33
```
34
35
### Install the python dependencies
36 8 Tony Fuller
1. `python3 -m pip install -r requirements.txt`
37
1. `python3 -m pip install tox`
38 1 Dan Smith
39
40
### Optional, but recommended: Install GitHub CLI
41
Via winget: `winget install --id GitHub.cli` or manually from [github.com](https://cli.github.com/)
42
43
Note: {user} as shown in paths above is the logged in Windows user
44
Note: The steps above were done on Windows 10 Pro, version 22H2
45 2 Dan Smith
46
## MacOS
47
48
### Install command-line tools
49
```shell
50
$ xcode-select --install
51
```
52
53
### Clone the chirp git repository
54
```shell
55
$ git clone https://github.com/kk7ds/chirp
56
$ cd chirp
57
```
58
59
### Install python requirements
60
```shell
61 8 Tony Fuller
$ python3 -m pip install -r requirements.txt
62
$ python3 -m pip install tox
63 2 Dan Smith
```
64
65 6 Dan Smith
(Note that `tox` is only needed for running tests, not for running chirp itself)
66 3 Dan Smith
67 2 Dan Smith
### Run chirp
68
```shell
69
$ ./chirpwx.py
70
```
71
72
## Linux
73
74
These instructions are for Debian/Ubuntu, but should be generally applicable to other distros, possibly with different package names. You can use all distro packages (recommended), or install the python requirements with `pip install -r requirements.txt` but you probably want to get wxPython from distro packages.
75
76
### Install packages
77
78
```shell
79 5 Dan Smith
$ sudo apt install git python3-wxgtk4.0 python3-serial python3-six python3-future python3-requests python3-pip
80 8 Tony Fuller
$ python3 -m pip install tox
81 1 Dan Smith
```
82 5 Dan Smith
83
(Note that `tox` is only needed for running tests, not for running chirp itself)
84 2 Dan Smith
85
### Clone the chirp git repository
86
```
87
$ git clone https://github.com/kk7ds/chirp
88
```
89
90
### Run chirp
91
```shell
92
$ cd chirp
93
$ ./chirpwx.py
94
```