Open main menu

Wiki-Orange Pi β

Changes

Orange Pi Zero 3

842 bytes added, 16:22, 11 July 2023
Install via python
=== Install via python ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Before installation, please replace the source of pip with a domestic source to speed up the installation of the Python package. For the configuration method, see the instructions in the section on [[Orange Pi Zero 3#Python to replace the pip source method|'''how to replace the pip source with Python''']].'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata'''</p>
|}{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''If it is debian12, please use the following command:'''</p>  
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3 python3-dev python3-venv \'''</p>
<p>'''python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential \'''</p>
<p>'''libopenjp2-7 libturbojpeg0-dev tzdata'''</p></big>|}</li><li><p>Then you need to compile and install Python3.9. For the method, please refer to the section on [[Orange Pi Zero 3#Python source code compilation and installation method|'''how to compile and install Python source code''']]</p>{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''The default Python version of Debian Bullseye is Python3.9, so there is no need to compile and install。install.'''</p><p>'''The default Python version of Ubuntu Jammy is Python3.10, so there is no need to compile and install。install.'''</p><p>'''The default Python version of Debian Bookworm is Python3.11, so there is no need to compile and install。install.'''</p></big>|}</li>
<li><p>Then create a Python virtual environment</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Debian Bookworm is python3.11, please remember to replace the corresponding command。'''</p></big>|}{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''sudo mkdir /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''sudo chown orangepi:orangepi /srv/homeassistant'''</p>
<p>orangepi@orangepi:~$ '''python3.9 -m venv .'''</p>
<p>orangepi@orangepi:~$ '''source bin/activate'''</p>
<p>(homeassistant) orangepi@orangepi:/srv/homeassistant$</p>|}</li>
<li><p>Then install the required Python package</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''python3 -m pip install wheel'''</p>|}</li>
<li><p>Then you can install Home Assistant Core</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''pip3 install homeassistant'''</p>|}</li>
<li><p>Then enter the following command to run Home Assistant Core</p>
{| class="wikitable" style="width:800px;" |-| <p>(homeassistant) orangepi@orangepi:/srv/homeassistant$ '''hass'''</p>|}</li>
<li><p>Then enter '''[IP address of the development board: 8123]''' in the browser to see the interface of Home Assistant</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''When running the hass command for the first time, you will download and install and cache some necessary libraries and dependencies to run. This process may take a few minutes. Note that at this time, the interface of Home Assistant cannot be seen in the browser. Please wait for a while before refreshing。'''</p></big>|}
<p>[[File:media/image194.png|576x203px]]</p></li></ol>