Die Installation von matplotlib für Python ist3 auf Ubuntu
Ich bin mit Ubuntu 12.04, und ich matpltlib
im Python 3.2.3. Habe ich erfolgreich installiert, es mit
sudo apt-get install python-matplotlib
Aber jetzt funktioniert es nur in Python 2.7, das scheint die Standard-version:
$ python2
Python 2.7.3 (default, Feb 27 2014, 20:00:17)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>>
Aber python 3 funktioniert nicht:
$ python3
Python 3.2.3 (default, Feb 27 2014, 21:33:50)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named matplotlib
>>>
Auch, meine python
Befehl zu sein scheint "kaputt":
$ python
bash: /usr/bin/python: No such file or directory
Jede Hilfe ist willkommen!
- Haben Sie pip für Python ist3 installiert (möglicherweise genannt pip3)? Dann installieren Sie alle Ihre Python ist3 Modul durch pip3 statt:
pip3 install matplotlib
. - Die gebrochenen python-Befehl kann(kommen) ein Thema für Ihr Betriebssystem: einige system-Werkzeuge, die wahrscheinlich
/usr/bin/python
. Es ist ein anderes problem, also besser eine neue Frage nur für die, die (eventuell auf askubuntu.com anstelle). - Danke für die Antwort! Leider ist der gebrochen-Befehl wird auch verhindert, dass mich von tryig, so werde ich haben, um das zu beheben zuerst.
~$ pip3 install matplotlib \n bash: /usr/bin/python: No such file or directory
- das ist leicht zu umgehen, indem ausgeführt
~$ python3 <full/path/to/pip3> install matplotlib
. - iirc zu installieren, müssen Sie
python3-matplotlib
Du musst angemeldet sein, um einen Kommentar abzugeben.
In Fall, jemand stößt auf diese, verwenden Sie einfach
Gibt es viele Pakete, die beteiligten mit
matplotlib
und mitapt-get
stattpip
dies ist die offiziell empfohlene Vorgehensweise.wenn Sie in virtualenv
Beispiel:
workon cv #cv is my virtualenv name