natlinkconfig_cli.exe and natlinkconfig_gui.exe break if tck/tk not installed by python installer.
Voxellence opened this issue · 6 comments
I've installed the latest pre-release of NatLink, 5.3.4, which I downloaded from the releases page.
When I run natlinkconfig_cli.exe I get the following:
Traceback (most recent call last):
File "C:\Python\Python310-32\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python\Python310-32\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Python\Python310-32\Scripts\natlinkconfig_cli.exe\__main__.py", line 4, in <module>
File "C:\Python\Python310-32\lib\site-packages\natlinkcore\configure\natlinkconfig_cli.py", line 8, in <module>
from natlinkcore.configure import natlinkconfigfunctions
File "C:\Python\Python310-32\lib\site-packages\natlinkcore\configure\natlinkconfigfunctions.py", line 31, in <module>
from natlinkcore import tkinter_dialogs
File "C:\Python\Python310-32\lib\site-packages\natlinkcore\tkinter_dialogs.py", line 18, in <module>
from tkinter import filedialog
ModuleNotFoundError: No module named 'tkinter'
When I run natlinkconfig_gui.exe, nothing happens.
tkinter is a standard python library. How was the python environment installed? We should add tk as a requirement to cover the edge case.
I uninstalled all versions of Python on my computer, even the ones installed by Visual Studio. I purged the registry of the three relevant nodes. Then I installed the 32-bit Python 3.10.7 executable located where this hyperlink points to.
I installed NatLink Core and NatLink in the order and from the sources you pointed me to.
Thanks.
Uninstall Python and try again using the natlink installer? Make sure to delete the python site packages directory
This time don't worry about installing natlink core. That's handled by the installer.
I just did a clean install with the latest release. Couldn't replicate the issue with the missing TK package. Paying attention to the python install the TK package was installed along with the Python environment.
Thanks, @LexiconCode. I was resisting the idea of letting NatLink install Python because I have my own preferred location. So after a quick Google I discovered that the installer wizard has a checkbox, "tcl/tk and IDLE", which is required to be checked in order to install tkinter. Therefore, I simply ran the installer again, chose Modify, and checked the checkbox. Bada boom, the configuration programs now work.
How do we prevent users from running into this?
How do we prevent users from running into this?
I don't know of any other methods except:
- Reinstall Python
- Modify an existing install through Python's installer.
Note:
- To my knowledge Python TK is enabled by default on the average Python install.
- When the Natlink installer installs Python TK is installed automatically.
When we have the install documentation we can make a note of this for users.