
Estoy intentando ejecutar un código python
que necesita mathplotlib
. Escribiendo:
python3 mouse_click.py
da el error
ImportError: No module named 'matplotlib'
Para instalar
sudo apt-get install python-matplotlib
El resultado es:
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-matplotlib is already the newest version.
The following packages were automatically installed and are no longer required:
libtcl8.5 libtk8.5 tcl8.5 tk8.5
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Se nota que todo está ok y ya lo instalé. Pero no lo es.
Después de eso he probado:
sudo apt-get install python3-mathplotlib
Resultado:
E: Unable to locate package python3-mathplotlib
Entonces lo he probado:
sudo apt-get build-dep python-matplotlib
Aquí está el resultado del código anterior:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'matplotlib' as source package instead of 'python-matplotlib'
The following packages have unmet dependencies:
python3-all-dbg : Depends: libpython3-all-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dbg but it is not going to be installed
python3-all-dev : Depends: libpython3-all-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dev but it is not going to be installed
python3-numpy-dbg : Depends: python3-dbg but it is not going to be installed
E: Build-dependencies for python-matplotlib could not be satisfied.
Finalmente:
sudo apt-get build-dep python3-matplotlib
Resultado:
Picking 'matplotlib' as source package instead of 'python3-matplotlib'
The following packages have unmet dependencies:
python3-all-dbg : Depends: libpython3-all-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dbg but it is not going to be installed
python3-all-dev : Depends: libpython3-all-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dev but it is not going to be installed
python3-numpy-dbg : Depends: python3-dbg but it is not going to be installed
E: Build-dependencies for python3-matplotlib could not be satisfied.
No instalé ningún Python porque ubuntu 14.04
ya tengo Python 3.4.3
. Necesito ayuda con la instalación mathplotlib
para ejecutar mi código.
Respuesta1
Usas python3
y por tanto necesitas python3-matplotlib
pero has cometido un error:
El nombre del paquete es python3-matplotlib
yno python3-mathplotlib
.
Por lo tanto instalar
sudo apt-get install python3-matplotlib
Instalación de las bibliotecas de desarrollo a través de
sudo apt-get build-dep …
no es necesario.