1

I've recently installed Ubuntu 14.04 and have been a python enthusiast for several years, since I used python in grad school for (text) data analysis.

I've noticed that 14.04 comes with both python 2.7 and 3.4. However, the repository only installs python modules for python 2.7. I was wondering if someone could walk me through the steps for installing modules for python 3.4 (specifically numpy and matplotlib) when the default "python" gives python 2.7.

Thanks. No rush on an answer.

1

2 Answers 2

1

As bain points out, you'll find that the python3.x modules have the a prefix of python3-<pkgname> . You can see this by searching the package cache (which includes packages available and not installed).

Here are a couple of relevant commands:

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

The ^python3 expression limits to packages that start with 'python3', and the '-n' limits the search to names (not long descriptions). You can remove those for more general searches.

Here's some sample output:

$ 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
1

Python 3 packages are prefixed with "python3". For numpy and matplotlib, install python3-numpy and python3-matplotlib.

0

Not the answer you're looking for? Browse other questions tagged .