Changes

Jump to: navigation, search

Orange Pi Zero 2W

238 bytes added, 14:26, 26 September 2023
How to replace pip source in Python
=== How to replace pip source in Python ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''The default source used by Linux system pip is the official source of Python. However, accessing the official source of Python in China is very slow, and the installation of Python software packages often fails due to network reasons. So when using pip to install the Python library, please remember to change the pip source.'''</big>|}
<ol style="list-style-type: decimal;">
<li><p>First install '''python3-pip'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''sudo apt-get update'''</p>
<p>orangepi@orangepi:~$ '''sudo apt-get install -y python3-pip'''</p>|}</li>
<li><p>How to permanently change the pip source under Linux</p>
<ol style="list-style-type: lower-alpha;">
<li><p>First create a new '''~/.pip''' directory, then add the &gt; '''pip.conf''' configuration file, and set the pip source in it &gt; to Tsinghua source.</p>{| class="wikitable" style="width:800px;" |-|
<p>orangepi@orangepi:~$ '''mkdir -p ~/.pip'''</p>
<p>orangepi@orangepi:~$ '''cat &lt;&lt;EOF &gt; ~/.pip/pip.conf'''</p>
<p>'''index-url = https://pypi.tuna.tsinghua.edu.cn/simple'''</p>
<p>'''trusted-host = pypi.tuna.tsinghua.edu.cn'''</p>
<p>'''EOF'''</p>|}</li>
<li><p>Then use pip3 to install the Python library very quickly</p></li></ol>
</li>
<li><p>How to temporarily change the pip source under Linux, where '''&lt;packagename&gt;''' needs to be replaced with a specific package name</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''pip3 install &lt;packagename&gt; -i \'''</p>
<p>'''https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn'''</p>|}</li></ol>
<span id="how-to-install-docker"></span>
 
== How to install Docker ==

Navigation menu