Project

General

Profile

ChirpOnLinux » History » Version 44

Dan Smith, 11/16/2024 08:55 AM

1 1 Dan Smith
# Running CHIRP on Linux
2 18 Dan Smith
{{>toc}}
3 1 Dan Smith
4 43 Dan Smith
This page describes how to get the newer python3-based CHIRP-next running on Linux. Note that this procedure is completely different from how chirp-daily was installed, and is not compatible with it. In case it's not clear, chirp-daily will not run on any modern Linux distro, and chirp-next will not run on anything older than about ubuntu 22.04 (circa 2022) or so.
5 1 Dan Smith
6 18 Dan Smith
## 1. Install distro packages
7 1 Dan Smith
8 18 Dan Smith
### Debian, Ubuntu, Mint, Raspbian, etc
9 1 Dan Smith
10
```
11 39 Dan Smith
$ sudo apt install python3-wxgtk4.0 pipx
12 1 Dan Smith
```
13 16 Jeffrey Vian
14 18 Dan Smith
### **Fedora and compatible**
15 1 Dan Smith
16 18 Dan Smith
This was tested on Fedora 37 with python 3.11. The same procedure should work on all current versions of fedora running python3.
17 16 Jeffrey Vian
18 1 Dan Smith
```
19 39 Dan Smith
$ sudo dnf install python3-wxpython4 pipx
20 1 Dan Smith
```
21 16 Jeffrey Vian
22 19 Dan Smith
## 2. Install CHIRP (and Python dependencies)
23 30 Dan Smith
24 37 Alexandre J. Raymond
Download the [chirp-yyyymmdd-py3-none-any.whl file](https://archive.chirpmyradio.com/chirp_next/) located under the folder corresponding to the latest date.
25 1 Dan Smith
26 37 Alexandre J. Raymond
The next steps should work for all versions of Linux using pip, assuming you have the base dependencies from the distro installed above. On all recent distros, you must use `pipx` to install CHIRP separated from the system python environment. However, because some libraries from the system environment are required (packages from above) you must use the flag to enable their use. Use of the wheel download is recommended.
27
28 36 Dan Smith
```
29 37 Alexandre J. Raymond
$ pipx install --system-site-packages ./chirp-yyyymmdd-py3-none-any.whl
30 35 Tony Fuller
```
31
32 37 Alexandre J. Raymond
**NOTE:** Use the filename you actually downloaded (ex: chirp-20240522-py3-none-any.whl), the above is just an example.
33 24 Dan Smith
34 38 Alexandre J. Raymond
## 3. Run CHIRP
35 24 Dan Smith
36 38 Alexandre J. Raymond
Now you can run CHIRP once from the command line with:
37 29 Dan Smith
38 16 Jeffrey Vian
```
39 36 Dan Smith
$ ~/.local/bin/chirp
40 1 Dan Smith
```
41 24 Dan Smith
42 38 Alexandre J. Raymond
The first time CHIRP is launched it should pop up a prompt to add a `.desktop` file for the current user. Select **yes** if you want to have the icon installed into the application menu (the *activities* menu in gnome) to launch CHIRP.
43 16 Jeffrey Vian
44 38 Alexandre J. Raymond
If you want to run CHIRP from the command line and simply using `chirp` does not work please check your `PATH` to verify it is complete. If not that can be fixed by editing `~/.bashrc` or `~/.bash_profile` to add that to the existing `$PATH`.  If the `PATH` is configured properly then CHIRP should be able to launch with the `chirp` command. Common locations would be `~/.local/bin` and `/usr/local/bin`.
45 18 Dan Smith
46 24 Dan Smith
Following the steps above (without `sudo`) installs the app as a user level app and it will only be accessible to that user. Using `sudo` for a system-wide installation is deprecated and not recommended on modern distros.
47 34 Jeffrey Vian
48 38 Alexandre J. Raymond
## 4. Update CHIRP
49 1 Dan Smith
50 38 Alexandre J. Raymond
Once CHIRP is properly installed, upgrades to newer versions are done with two simple steps:
51 33 Dan Smith
52 32 Dan Smith
1. Download the newer file.
53 38 Alexandre J. Raymond
1. Uninstall the old version: `pipx uninstall chirp`
54
1. Install the updated version by re-doing step 2 above
55 10 Jeffrey Vian
56 40 Dan Smith
# Troubleshooting
57
58 29 Dan Smith
## Serial port permissions
59 10 Jeffrey Vian
60 18 Dan Smith
Note that you may need to add your users who want to use CHIRP to the group that owns the serial ports. This issue is often indicated by an "access denied" error when accessing serial port. First determine the USB port of your device, and then the following command should add your user to the proper group:
61 23 Jeffrey Vian
Note that "ttyUSB0" should be replaced with the actual device that identifies your connection to the radio and that "$USER" is a system variable that identifies the username of the individual running the command.
62 15 Jeffrey Vian
63 10 Jeffrey Vian
```
64 18 Dan Smith
sudo usermod -a -G $(stat -c %G /dev/ttyUSB0) $USER
65 9 Jeffrey Vian
```
66
67 11 Dan Smith
If that made a change, you will then need to log out and back in (or maybe even reboot) for it to take effect.
68 1 Dan Smith
69 40 Dan Smith
## (Optional) Newer `wxPython`
70 9 Jeffrey Vian
71 16 Jeffrey Vian
You may want to install a newer wxPython, depending on what your distro ships. For Debian-derived distros (including Ubuntu and Mint) you can do that with a command like:
72 1 Dan Smith
```
73
pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
74
```
75 24 Dan Smith
76
This is only recommended for older distros, like Ubuntu 20.04.
77
78 1 Dan Smith
Check the [directory listing](https://extras.wxpython.org/wxPython4/extras/linux/gtk3/) for other distro versions and use the closest match to what you're on. **NOTE** that this will not work for non-x86_64 machines (like the Raspberry Pi) as there are no binary builds for those platforms.
79 40 Dan Smith
80
## Python or other version requirements
81
82
If you are running on an older distro, you may see complaints about either the python version or other system libraries being too old, such as the following:
83
84
```
85
ERROR: Package 'chirp' requires a different Python: 3.9.2 not in '<4,>=3.10'
86
```
87
88 42 Dan Smith
In general, we try to keep in mind the versions of packages available in current and recent distro releases and try not to push the requirements past those points unless we need to. But, if you see something like the above, then you likely need to update to a newer distro release. You can find some version specifics about python requirements [here](https://github.com/kk7ds/chirp/blob/master/requirements.txt) and dependent packages [here](https://github.com/kk7ds/chirp/blob/master/setup.py).
89
90
You can find out the (default) version of python available in your distro by doing the following:
91
92
```
93
$ python3 --version
94
Python 3.9.2
95
```
96
97
The other major system dependency that is needed is wxPython. Once you have installed your distro's package for it (see the top of this page), you can check the version by doing this:
98
99
```
100
$ python3 -c "import wx;print(wx.__version__)"
101
4.0.7
102
```
103 44 Dan Smith
104
## The yattag package may not be installable in pipx
105
106
In late 2024, the yattag python package (on which chirp depends) may not be installable in very new versions of `pipx`. This is not a CHIRP bug, so please do not report it as such. At least on Debian-derived distributions you can work around this by running:
107
```
108
$ apt install python3-yattag
109
```
110
To get the distro-supplied version of the library.