Project

General

Profile

DevelopersPython3Environment » History » Version 5

Dan Smith, 12/14/2022 11:37 PM

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
1. Optional, if you want to set an editor: `git config --global core.editor "PATH TO EDITOR"
26
      
27
28
### Clone the chirp git repository (py3 branch)
29
From a command line:
30
```
31
C:\Users\{user}\Documents> git clone https://github.com/kk7ds/chirp
32
C:\Users\{user}\Documents> cd chirp
33
C:\Users\{user}\Documents> git checkout origin/py3 -b py3
34
```
35
36
### Install the python dependencies
37
1. `python3 -mpip install -r requirements.txt`
38
1. `python3 -mpip install tox`
39
40
41
### Optional, but recommended: Install GitHub CLI
42
Via winget: `winget install --id GitHub.cli` or manually from [github.com](https://cli.github.com/)
43
44
Note: {user} as shown in paths above is the logged in Windows user
45
Note: The steps above were done on Windows 10 Pro, version 22H2
46 2 Dan Smith
47
## MacOS
48
49
### Install command-line tools
50
```shell
51
$ xcode-select --install
52
```
53
54
### Clone the chirp git repository
55
```shell
56
$ git clone https://github.com/kk7ds/chirp
57
$ cd chirp
58
```
59
60
### Install python requirements
61
```shell
62
$ python3 -mpip install -r requirements.txt
63
$ python3 -mpip install tox
64
```
65
66 4 Dan Smith
(note that `tox` is only needed for running tests, not for running chirp itself)
67 3 Dan Smith
68 2 Dan Smith
### Run chirp
69
```shell
70
$ ./chirpwx.py
71
```
72
73
## Linux
74
75
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.
76
77
### Install packages
78
79
```shell
80 5 Dan Smith
$ sudo apt install git python3-wxgtk4.0 python3-serial python3-six python3-future python3-requests python3-pip
81
$ python3 -mpip install tox
82 1 Dan Smith
```
83 5 Dan Smith
84
(Note that `tox` is only needed for running tests, not for running chirp itself)
85 2 Dan Smith
86
### Clone the chirp git repository
87
```
88
$ git clone https://github.com/kk7ds/chirp
89
```
90
91
### Run chirp
92
```shell
93
$ cd chirp
94
$ ./chirpwx.py
95
```