아래와 같은 에러 발생 시
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 115, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup [backend_name], 0) File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 4, in <module> from . import tkagg # Paint image to Tk photo blitter extension. File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/tkagg.py", line 5, in <module> from six.moves import tkinter as Tk File "/usr/lib/python2.7/dist-packages/six.py", line 203, in load_module mod = mod._resolve() File "/usr/lib/python2.7/dist-packages/six.py", line 115, in _resolve return _import_module(self.mod) File "/usr/lib/python2.7/dist-packages/six.py", line 82, in _import_module __import__(name) File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 42, in <module> raise ImportError, str(msg) + ', please install the python-tk package' ImportError: No module named _tkinter, please install the python-tk package | cs |
python-tk 패키지가 없어서 발생하는 오류로 설치를 진행합니다.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | $ sudo apt-get -y install vsftpd Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: vsftpd 0 upgraded, 1 newly installed, 0 to remove and 13 not upgraded. Need to get 115 kB of archives. After this operation, 336 kB of additional disk space will be used. Get:1 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 vsftpd amd64 3.0.3-3 ubuntu2 [115 kB] Fetched 115 kB in 0s (301 kB/s) Preconfiguring packages ... Selecting previously unselected package vsftpd. (Reading database ... 198798 files and directories currently installed.) Preparing to unpack .../vsftpd_3.0.3-3ubuntu2_amd64.deb ... Unpacking vsftpd (3.0.3-3ubuntu2) ... Processing triggers for systemd (229-4ubuntu21.2) ... Processing triggers for ureadahead (0.100.0-19) ... Processing triggers for man-db (2.7.5-1) ... Setting up vsftpd (3.0.3-3ubuntu2) ... Processing triggers for systemd (229-4ubuntu21.2) ... Processing triggers for ureadahead (0.100.0-19) ... rabbit@rabbit-virtual-machine:~$ sudo service vsftpd start rabbit@rabbit-virtual-machine:~$ vi /etc/vsftpd.conf rabbit@rabbit-virtual-machine:~$ sudo vi /etc/vsftpd.conf rabbit@rabbit-virtual-machine:~$ sudo vi /etc/vsftpd.conf rabbit@rabbit-virtual-machine:~$ sudo service vsftpd restart rabbit@rabbit-virtual-machine:~$ sudo apt-get -y install python-tk Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: blt tk8.6-blt2.5 Suggested packages: blt-demo tix python-tk-dbg The following NEW packages will be installed: blt python-tk tk8.6-blt2.5 0 upgraded, 3 newly installed, 0 to remove and 13 not upgraded. Need to get 605 kB of archives. After this operation, 2,123 kB of additional disk space will be used. Get:1 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 tk8.6-blt2.5 amd64 2 .5.3+dfsg-3 [574 kB] Get:2 http://kr.archive.ubuntu.com/ubuntu xenial/main amd64 blt amd64 2.5.3+dfsg -3 [4,852 B] Get:3 http://kr.archive.ubuntu.com/ubuntu xenial-updates/main amd64 python-tk am d64 2.7.12-1~16.04 [26.3 kB] Fetched 605 kB in 0s (1,895 kB/s) Selecting previously unselected package tk8.6-blt2.5. (Reading database ... 198855 files and directories currently installed.) Preparing to unpack .../tk8.6-blt2.5_2.5.3+dfsg-3_amd64.deb ... Unpacking tk8.6-blt2.5 (2.5.3+dfsg-3) ... Selecting previously unselected package blt. Preparing to unpack .../blt_2.5.3+dfsg-3_amd64.deb ... Unpacking blt (2.5.3+dfsg-3) ... Selecting previously unselected package python-tk. Preparing to unpack .../python-tk_2.7.12-1~16.04_amd64.deb ... Unpacking python-tk (2.7.12-1~16.04) ... Processing triggers for libc-bin (2.23-0ubuntu10) ... Setting up tk8.6-blt2.5 (2.5.3+dfsg-3) ... Setting up blt (2.5.3+dfsg-3) ... Setting up python-tk (2.7.12-1~16.04) ... Processing triggers for libc-bin (2.23-0ubuntu10) ... | cs |
설치 후 다시 임포트를 진행합니다.
1 2 3 | >>> import matplotlib.pyplot as plt >>> | cs |
'Open Source > TensorFlow' 카테고리의 다른 글
[에러] 'module' object has no attribute 'merge_all_summaries' (0) | 2018.07.19 |
---|---|
[에러] 'module' object has no attribute 'mul' (0) | 2018.07.19 |