擅长:python、mysql、java
<p>从FreeBSD 12.0开始,正确答案如下。</p>
<ol>
<li>在<code>/tmp/makePatchPython3.6.patch</code>中创建包含以下内容的文件:</li>
</ol>
<pre><code>1,2d0
< DEFAULT_VERSIONS += python=3.6
<
</code></pre>
<p>这将在<code>/etc/make.conf</code>的开头添加一行,这将更改系统上使用的默认python。</p>
<pre><code>[/usr/ports/lang/python]$ sudo make deinstall
[/usr/ports/lang/python]$ sudo patch /etc/make.conf /tmp/makePatchPython3.6.patch
[/usr/ports/lang/python]$ sudo make reinstall
[/usr/ports/lang/python]$ python --version
Python 3.6.8 # This will be different depending on which python version you install.
</code></pre>