No module named Tkinter

I have a small script in python2.7 that I want to convert to a Windows executable. For this I use pyinstaller.

script:

import sys 
import matplotlib.pyplot as plt
import matplotlib.image as mpimg


def get_inputs():
    coor = raw_input(">>>top x left: ").replace(" ", "")
    top, left = coor.split("x")
    top = int(top.strip())
    left = int(left.strip())
    return top, left 

def plot_location(top, left):
    img= mpimg.imread('nbahalfcourt.jpg')
    plt.imshow(img)
    plt.scatter(left, top)
    plt.grid()
    plt.show()

def main():
    top, left = get_inputs()
    plot_location(top, left)

if __name__ == '__main__':

    print "Input top x left coordinates (no space) eg: 44x232"

    run = True 
    while run:
        main()

Basically, the script simply displays a point on the grid.

The conversion process is successful. When I run .exe, however, I have ImportError(see below), although I do not refer to anywhere Tkinter.

enter image description here

What could go wrong here?

+4
source share
2 answers

, matplotlib Tkinter, . pyinstaller , Tkinter , .

import Tkinter script.

+5

, . Pyinstaller 3.2 ( ), ( ), ,

pip install https://github.com/pyinstaller/pyinstaller/archive/develop.zip

, -, , .

EDIT. 15 2017 Pyinstaller 3.2.1. , , this , . , .

+3

All Articles