[FreeBSD] 11.1 に python 3 をインストールする方法
以下のように実行しました。
2 つ目のコマンドですが、
sudo pkg install python36
を実行しました。これは良くなかったかもしれません。(後述)
% sudo pkg search python3 ap22-mod_python33-3.3.1_8 Apache module that embeds the Python interpreter within the server ap24-mod_python35-3.5.0_2 Apache module that embeds the Python interpreter within the server boost-python3-libs-1.64.0 Framework for interfacing Python 3 and C++ py27-wxPython30-3.0.2.0_3 GUI toolkit for the Python programming language python3-3_3 The "meta-port" for version 3 of the Python interpreter python33-3.3.6_11 Interpreted object-oriented programming language python34-3.4.7 Interpreted object-oriented programming language python35-3.5.4 Interpreted object-oriented programming language python36-3.6.1_4 Interpreted object-oriented programming language % sudo pkg install python36 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 3 package(s) will be affected (of 0 checked): New packages to be INSTALLED: python36: 3.6.1_4 readline: 7.0.3 libffi: 3.2.1 Number of packages to be installed: 3 The process will require 102 MiB more space. 15 MiB to be downloaded. Proceed with this action? [y/N]: y [1/3] Fetching python36-3.6.1_4.txz: 100% 15 MiB 638.2kB/s 00:24 [2/3] Fetching readline-7.0.3.txz: 100% 334 KiB 342.4kB/s 00:01 [3/3] Fetching libffi-3.2.1.txz: 100% 34 KiB 35.2kB/s 00:01 Checking integrity... done (0 conflicting) [1/3] Installing readline-7.0.3... [1/3] Extracting readline-7.0.3: 100% [2/3] Installing libffi-3.2.1... [2/3] Extracting libffi-3.2.1: 100% [3/3] Installing python36-3.6.1_4... Extracting python36-3.6.1_4: 100% Message from python36-3.6.1_4: =========================================================================== Note that some standard Python modules are provided as separate ports as they require additional dependencies. They are available as: py36-gdbm databases/py36-gdbm py36-sqlite3 databases/py36-sqlite3 py36-tkinter x11-toolkits/py36-tkinter =========================================================================== % which python3 python3: Command not found. % which python python: Command not found. % sudo find / -name *python* -print sudo: No match. %
python がインストールされていないことがわかります。
調べたところ、
以下のように
sudo pkg install python3
と実行して
python3: 3_3 パッケージをインストールする必要があったようです。
% sudo pkg install python3 Updating FreeBSD repository catalogue... FreeBSD repository is up to date. All repositories are up to date. The following 1 package(s) will be affected (of 0 checked): New packages to be INSTALLED: python3: 3_3 Number of packages to be installed: 1 1 KiB to be downloaded. Proceed with this action? [y/N]: y [1/1] Fetching python3-3_3.txz: 100% 1 KiB 1.1kB/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing python3-3_3... Extracting python3-3_3: 100% % which python python: Command not found. % which python3 /usr/local/bin/python3 %
python 3 が無事インストールされました。
sudo pkg install python36
ではダメだったようです。
% python3 Python 3.6.1 (default, Aug 12 2017, 01:16:05) [GCC 4.2.1 Compatible FreeBSD Clang 3.8.0 (tags/RELEASE_380/final 262564)] on freebsd11 Type "help", "copyright", "credits" or "license" for more information. >>> exit () %
python 3.6.1 が使えるようになりました。これからいろいろ遊んでいこうと思います。