Python3 モジュール

Python3 モジュール

私は最近 Ubuntu 14.04 をインストールしました。大学院時代に (テキスト) データ分析に Python を使用して以来、数年間 Python に熱中しています。

14.04 には Python 2.7 と 3.4 の両方が付属していることに気付きました。ただし、リポジトリでは Python 2.7 用の Python モジュールのみがインストールされます。デフォルトの「python」では Python 2.7 が提供される場合に、Python 3.4 用のモジュール (具体的には numpy と matplotlib) をインストールする手順を教えていただけないでしょうか。

ありがとう。返事を急ぐ必要はありません。

答え1

bain が指摘しているように、python3.x モジュールには というプレフィックスが付いていますpython3-<pkgname>。これは、パッケージ キャッシュ (使用可能なパッケージとインストールされていないパッケージが含まれます) を検索することで確認できます。

関連するコマンドをいくつか示します。

apt-cache search numpy | egrep ^python3  # search for numpy, python3
apt-cache search -n ^python3             # search only package names for python3

この^python3式は 'python3' で始まるパッケージに限定され、'-n' は検索を名前 (長い説明ではない) に限定します。より一般的な検索を行うには、これらを削除できます。

出力例を次に示します。

$ apt-cache search numpy | egrep ^python3
python3-numpy - Fast array facility to the Python 3 language
python3-numpy-dbg - Fast array facility to the Python 3 language (debug extension)
python3-h5py - h5py is a general-purpose Python interface to hdf5
python3-mpi4py - bindings of the Message Passing Interface (MPI) standard
python3-mpi4py-dbg - bindings of the MPI standard -- debug symbols
python3-numexpr - Fast numerical array expression evaluator for Python 3 and NumPy
python3-numexpr-dbg - Fast numerical array expression evaluator for Python 3 and NumPy (debug ext)
python3-pyproj - Python 3 interface to PROJ.4 library
python3-scipy - scientific tools for Python 3
python3-scipy-dbg - scientific tools for Python 3 - debugging symbols
python3-tables - hierarchical database for Python3 based on HDF5
python3-tables-dbg - hierarchical database for Python 3 based on HDF5 (debug extension)
python3-tables-lib - hierarchical database for Python3 based on HDF5 (extension)


$ apt-cache search -n ^python3
python3 - interactive high-level object-oriented language (default python3 version)
python3-all - package depending on all supported Python 3 runtime versions
python3-all-dbg - package depending on all supported Python 3 debugging packages
python3-all-dev - package depending on all supported Python 3 development packages
python3-amqp - Low-level AMQP client (Python3 version)
python3-apparmor - AppArmor Python3 utility library
python3-apparmor-click - Click manifest to AppArmor easyprof conversion tools
python3-apport - Python 3 library for Apport crash report handling
python3-apt - Python 3 interface to libapt-pkg
python3-apt-dbg - Python 3 interface to libapt-pkg (debug extension)
python3-aptdaemon - Python 3 m[...]

答え2

Python 3パッケージには「python3」というプレフィックスが付いています。numpyとmatplotlibの場合は、python3-numpyそしてpython3-matplotlib

関連情報