-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathbuild.html
127 lines (122 loc) · 9.33 KB
/
build.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>PyRadio Build Instructions</title>
<style>
body {padding: 2em;}
@media screen and (max-width: 770px) {
body {padding: 10px;}
}
body {max-width: 750px; margin: auto;}
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
h4 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;}
h4:before {content: "# "; font-weight: bold; vertical-align: middle;}
h5 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;;}
h5:before {content: "## "; font-weight: bold; vertical-align: middle;}
p, table, ol, ul {margin-left: .8em;}
STRONG {color: SaddleBrown;}
dl {margin: 2em;}
dd {margin: 1em;}
dt {font-weight: bold;}
TABLE {border: 1px solid SaddleBrown; border-collapse: collapse; margin-left: auto; margin-right: auto; border-radius: 5px; -moz-border-radius: 5px; border-collapse:separate; box-shadow: 5px 5px 15px #888888;}
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;}
pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;}
.task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;}
img{display: block; margin-left: auto; margin-right: auto; max-width: 750px; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;}
.indented {text-indent: -1.5em; padding-left: 1.5em; margin-left: 1em;}
a{ color: SaddleBrown;}
a:visited{color: SaddleBrown;}
</style>
</head>
<body>
<header id="title-block-header">
</header>
<h1 style="color: SaddleBrown" id="pyradio-build-instructions">PyRadio Build Instructions</h1>
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<!-- vim-markdown-toc Marked -->
<ul>
<li><a href="#current-state-of-the-project">Current state of the project</a>
<ul>
<li><a href="#what-does-it-all-mean-and-why-should-you-care">What does it all mean and why should you care</a></li>
<li><a href="#when-do-i-need-to-install-pipx?">When do I need to install pipx?</a>
<ul>
<li><a href="#more-info">More info</a></li>
</ul></li>
<li><a href="#installation-on-the-bsds">Installation on the BSDs</a></li>
<li><a href="#rasberry-pi-installation">Rasberry Pi installation</a></li>
</ul></li>
<li><a href="#installation-guides">Installation guides</a></li>
</ul>
<!-- vim-markdown-toc -->
<p class="indented">[ <a href="index.html#installation">Return to main doc</a> ]</p>
<h2 id="current-state-of-the-project">Current state of the project <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<p>Starting with version <strong>0.9.2.6</strong>, <strong>PyRadio</strong> has changed (yet again) its installation method, forced by the emergance of Ubuntu 23.04.</p>
<p>After abandoning invoking <em>setup.py</em> directly, now it’s time to start using <strong>virtual environments</strong> (through a program called pipx) along with the pure pip method.</p>
<p>This is not a <strong>PyRadio</strong> thing; distributions are starting to embrace this behaviour.</p>
<p>The rationale behind this move it this: since pip can be used to install packages <strong>system wide</strong>, it can easily “destroy” the whole python installation. This would be the equivalent of forcing the installation of an Ubuntu package in a Debian system or a Debian 11 package on a Debian 8 system.</p>
<p>At the same time, python scripts and packages are already used by distributions to provide system tools and breaking a system’s python installation may lead to breaking the whole system.</p>
<p>The solution is forcing the use of <strong>virtual environments</strong> for any python script or program or package that is <strong>not provided</strong> by the distribution itself, effectively isolating the program’s installation from the rest of the system. Any program, package or module installed within the <strong>virtual environment</strong> exists and lives within that environment only, it does not interfere with the distribution’s Python installation and cannot “destroy” it.</p>
<p>Python <strong>virtual environments</strong> have existed for a long time, but their use was not always that straight forward. Fortunately, a program called <a target="_blank" href="https://pypa.github.io/pipx/">pipx</a> will help with the installation and execution of python programs from within a virtual environment while taking care of the overhead required.</p>
<h3 id="what-does-it-all-mean-and-why-should-you-care">What does it all mean and why should you care</h3>
<p>Moving to the <strong>pipx</strong> means:</p>
<ol type="1">
<li><p><strong>PyRadio</strong> will be installed by default through pipx on Linux, if pipx is already installed.</p></li>
<li><p>If a Linux distribution does not provide a pipx package, you can still use the pip installation method.</p></li>
<li><p><strong>PyRadio</strong> on <strong>Windows</strong> will still use the pip installation method.</p></li>
<li><p><strong>PyRadio</strong> will only be installed using pipx on <strong>Python 3</strong> on <strong>MacOS</strong>.</p></li>
</ol>
<h3 id="when-do-i-need-to-install-pipx">When do I need to install pipx?</h3>
<p>If you already have <strong>PyRadio</strong> installed, a subsequent update notification may lead to an installation failure. The same goes if you try to install <strong>PyRadio</strong> on a freshly installed Ubuntu 23.04 (or Debian or any other distribution that ships its python “externally managed” in the future).</p>
<p>This is what you get on Ubuntu 23.04 (and probably Debian and any distribution based on them):</p>
<pre>error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv [1] for more information.
--
[1] https://sources.debian.org/src/python3.11/3.11.2-6/debian/README.venv</pre>
<p>If you get that message, or a similar one, it is time to install pipx.</p>
<h4 id="more-info">More info</h4>
<ul>
<li><p><a target="_blank" href="https://packaging.python.org/en/latest/specifications/externally-managed-environments/">Externally Managed Environments @ PyPA</a></p></li>
<li><p><a target="_blank" href="https://peps.python.org/pep-0668/">PEP 668 – Marking Python base environments as “externally managed”</a></p></li>
</ul>
<h3 id="installation-on-the-bsds">Installation on the BSDs</h3>
<p>If you are on any of the BSDs, please do install <strong>bash</strong> beforehand and try to follow the <a href="linux.html">pip installation guide</a>.</p>
<p>Please be aware that <strong>PyRadio</strong> is provided as a <strong>port</strong> on <a target="_blank" href="https://www.freshports.org/audio/py-pyradio/">FreeBSB</a>.</p>
<h3 id="rasberry-pi-installation">Rasberry Pi installation</h3>
<p>If installing on a Rasberry Pi, there are a couple of things you should be aware of:</p>
<ol type="1">
<li>The default player will be <strong>MPlayer</strong></li>
<li>If you still want to use <strong>MPV</strong>, please make sure you increase the <em>Connection timeout</em> value to at least 20 (sometimes even 30 for some machines). Even then, your machine may eventually crash, if it’s on the lower end of things and <strong>PyRadio</strong> is left running for hours.</li>
</ol>
<h2 id="installation-guides">Installation guides <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
<p>Please follow the installation guides for your OS.</p>
<ol type="1">
<li>Linux
<ul>
<li><a href="linux.html">pip installation</a> (the old way)<br />
Not valid for <strong>Debian</strong> and <strong>Ubuntu 23.04</strong></li>
<li><a href="linux-pipx.html">pipx installation</a> (the new way)<br />
Valid for <strong>Debian</strong> and <strong>Ubuntu 23.04</strong> and newer</li>
</ul></li>
<li>MacOS<br />
Follow the instructions on <a href="macos.html">this page</a>.</li>
<li>Windows<br />
Follow the instructions on <a href="windows.html">this page</a>.</li>
</ol>
</body>
</html>