nicolas-f / 7DTD-leaflet

7 Days to Die discovered map into your browser !
http://nicolas-f.github.io/7DTD-leaflet/
GNU Affero General Public License v3.0
38 stars 12 forks source link

No module named _tkinter #1

Closed qriff closed 10 years ago

qriff commented 10 years ago

When running the latest I get this error on Debian 3.2.0-4-amd64 #1 SMP Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux, Python 2.7.3 (latest, Debian):

7DTD-leaflet-1.0# python map_reader.py

Traceback (most recent call last):
  File "map_reader.py", line 252, in <module>
    main()
  File "map_reader.py", line 235, in main
    import tkFileDialog
  File "/usr/lib/python2.7/lib-tk/tkFileDialog.py", line 43, in <module>
    from tkCommonDialog import Dialog
  File "/usr/lib/python2.7/lib-tk/tkCommonDialog.py", line 11, in <module>
    from Tkinter import *
  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

Obviously pulling in apt-get install python-tk will also pull x11 which is a quite hefty requirement for a headless server and a command line daemon.

Basically the error message is quite misleading.

Apparently adding the -m parameter removes the python-tk requirement but halts at

7DTD-leaflet-1.0# python map_reader.py -m "/home/sdtd/instances/One/Random Gen/One/Player"

Usage:
 -m "C:\Users..":        The folder that contain .map files
 -t "tiles":             The folder that will contain tiles (Optional)
 -z 8:                           Zoom level 4-n. Number of tiles to extract around position 0,0 of map. It is in the form of 4^n tiles.It will extract a grid of 2^n*16 tiles on each side.(Optional)

Where it just sits and waits for keypress after which it returns to command prompt.

So it looks like there is a typo at

        for opt, value in getopt.getopt(sys.argv[1:], "g:")[0]:
            if opt == "-g":

which should be

        for opt, value in getopt.getopt(sys.argv[1:], "m:")[0]:
            if opt == "-m":

after which it works.

nicolas-f commented 10 years ago

Hi,

Thank you for the report

nicolas-f commented 10 years ago

Fixed in last release