Módulos Python3

Módulos Python3

Instalei recentemente o Ubuntu 14.04 e sou um entusiasta do python há vários anos, desde que usei o python na pós-graduação para análise de dados (de texto).

Percebi que o 14.04 vem com o python 2.7 e o 3.4. No entanto, o repositório instala apenas módulos python para python 2.7. Eu queria saber se alguém poderia me orientar nas etapas de instalação de módulos para python 3.4 (especificamente numpy e matplotlib) quando o "python" padrão fornece python 2.7.

Obrigado. Não há pressa em responder.

Responder1

Como aponta Bain, você descobrirá que os módulos python3.x têm o prefixo a de python3-<pkgname>. Você pode ver isso pesquisando no cache de pacotes (que inclui pacotes disponíveis e não instalados).

Aqui estão alguns comandos relevantes:

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

A ^python3expressão limita-se a pacotes que começam com 'python3', e o '-n' limita a pesquisa a nomes (não a descrições longas). Você pode removê-los para pesquisas mais gerais.

Aqui está um exemplo de saída:

$ 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[...]

Responder2

Os pacotes Python 3 são prefixados com "python3". Para numpy e matplotlib, instalepython3-numpyepython3-matplotlib.

informação relacionada