简体   繁体   中英

python-tk package for tensorflow on windows

I installed tensorflow and Docker Tool Box on windows.Tensorflow runs on the virtual machine in docker tool box.Everything went well except when I type 'import matplotlib.pyplot as plt', an error occured that 'no module named _tkinter please install the python-tk package'.I tried to use 'pip install python-tk ' but it does not work. However, there is no error when I run it on local host. Plus the default version installed on my laptop is python 3.5 while the default version shown on tensorflow is 2.7. Did anyone know how to solve this?

I've got the same problem.

Solved it by running next commands in terminal:

sudo apt-get update
sudo apt-get install python-tk

After that import was successfull.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM