Python - インストール - FreeBSD
1. 概要 「FreeBSD」では、他のアプリケーションをインストールしているときに、「python」に依存するなにものかが大概おりまして。 気づいたら、「python」は、インストールされているということにはなっております。 2. インストール 以下、「FreeBSD 14.2 RELEASE」で。 2025年2月19日時点では、下記の状態にありまして。 $ ls -dlah python* drwxr-xr-x 2 root wheel 4 8月 29 19:20 python drwxr-xr-x 2 root wheel 5 12月 13 07:31 python-doc-html drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-pdf-a4 drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-pdf-letter drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-text drwxr-xr-x 2 root wheel 7 8月 29 19:20 python-mode.el drwxr-xr-x 2 root wheel 4 8月 29 19:20 python-tools drwxr-xr-x 2 root wheel 4 8月 29 19:20 python2 drwxr-xr-x 3 root wheel 9 8月 29 19:20 python27 drwxr-xr-x 2 root wheel 4 8月 29 19:20 python3 drwxr-xr-x 3 root wheel 8 12月 5 17:47 python310 drwxr-xr-x 3 root wheel 8 12月 13 07:47 python311 drwxr-xr-x 3 root wheel 8 9月 16 09:19 python38 drwxr-xr-x 3 root wheel 8 2月 17 07:40 python39 「python311」を使用することにしています。 他のバージョンとの競合を避けるには。 /etc/make.conf に以下を記述しておきます。 DEFAULT_VERSIONS+=python=3.11 pythonr3=3.11 明示的にインストールする場合。 オプションはないようなのでいきなりインストールします。 cd /usr/ports/lang/python make make install 2025年2月19日時点で、バージョンを確認してみます。 $ python --version Python 3.11.11
$ ls -dlah python* drwxr-xr-x 2 root wheel 4 8月 29 19:20 python drwxr-xr-x 2 root wheel 5 12月 13 07:31 python-doc-html drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-pdf-a4 drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-pdf-letter drwxr-xr-x 2 root wheel 3 8月 29 19:20 python-doc-text drwxr-xr-x 2 root wheel 7 8月 29 19:20 python-mode.el drwxr-xr-x 2 root wheel 4 8月 29 19:20 python-tools drwxr-xr-x 2 root wheel 4 8月 29 19:20 python2 drwxr-xr-x 3 root wheel 9 8月 29 19:20 python27 drwxr-xr-x 2 root wheel 4 8月 29 19:20 python3 drwxr-xr-x 3 root wheel 8 12月 5 17:47 python310 drwxr-xr-x 3 root wheel 8 12月 13 07:47 python311 drwxr-xr-x 3 root wheel 8 9月 16 09:19 python38 drwxr-xr-x 3 root wheel 8 2月 17 07:40 python39
/etc/make.conf
DEFAULT_VERSIONS+=python=3.11 pythonr3=3.11
cd /usr/ports/lang/python make make install
$ python --version Python 3.11.11