Changes

Jump to: navigation, search

Orange Pi Zero 3

407 bytes added, 15:56, 11 July 2023
Python source code compilation and installation method
=== Python source code compilation and installation method ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''If the Python version in the Ubuntu or Debian system software warehouse does not meet the requirements of development, if you want to use the latest version of Python, you can use the following method to download the source code package of Python to compile and install the latest version of Python.'''
'''The following demonstration is the latest version of the compilation and installation of Python3.9. If you want to compile and install other versions of Python, the method is the same (need to download the source code corresponding to the Python you want to install).'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>First install the dependency package required to compile Python</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y build-essential zlib1g-dev \'''</p>
<p>'''libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev \'''</p>
<p>'''libreadline-dev libffi-dev curl libbz2-dev'''</p>|}</li>
<li><p>Then download the latest version of the Python3.9 source code and decompress it</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''wget \'''</p>
<p>[https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz '''https://www.python.org/ftp/python/3.9.10/Python-3.9.10.tgz''']</p>
<p>orangepi@orangepi:~$ '''tar xvf Python-3.9.10.tgz'''</p>|}</li>
<li><p>Then run the configuration command</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''cd Python-3.9.10'''</p>
<p>orangepi@orangepi:~$ '''./configure --enable-optimizations'''</p>|}</li>
<li><p>Then compile and install python3.9, the compilation time takes about half an hour</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''make -j4'''</p>
<p>orangepi@orangepi:~$ '''sudo make altinstall'''</p>|}</li>
<li><p>After installation, you can use the following command to view the Python version number just installed</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''python3.9 --version'''</p>
<p>'''Python 3.9.10'''</p>|}</li>
<li><p>Then update pip</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''/usr/local/bin/python3.9 -m pip install --upgrade pip'''</p>|}</li></ol>
<span id="python-to-replace-the-pip-source-method"></span>
 
=== Python to replace the pip source method ===

Navigation menu