Problem loading simple Python script under Hexchat 2.16.1 on Windows 10 reddit / irc ---------------------------------------------------------------------- Fuddy-D · 2023-05-08 07:02 Can anyone shed any light on this problem? I recently updated to HexChat 2.16.1 (Windows) and told the installer to add the Python plugin. However, when HexChat starts, I see this error... Python interface loaded Failed to load module: 'encoding' is an invalid keyword argument for this function Traceback (most recent call last): File "", line 149, in loadfile TypeError: 'encoding' is an invalid keyword argument for this function Failed to load module: 'encoding' is an invalid keyword argument for this function Traceback (most recent call last): If I type /py, that works, and if I try to execute simple commands via /py exec, that works too. But if I try to load a simple hello.py with /py load, that returns an error similar to above. For the record, I have Python 2.7.18 installed, and I'm running on Windows 10. I'm assuming the module it failed to load is my hello world script, because it is currently the only file in my addons directory. It is as follows, (which was stolen from here --> [https://gist.github.com/Sven 65/18bd992735d7942db110](https://gist.github.com/Sven65/18bd992735d794 2db110)) \------ \# -\*- coding: UTF-8 -\*- ​ import hexchat ​ \_\_module\_name\_\_ = "hello" \_\_module\_version\_\_ = "1.0" \_\_module\_description\_\_ = "Python module example" ​ def hello(word, word\_eol, userdata): print("Hello, World!") return hexchat.EAT\_ALL ​ hexchat.hook\_command('hello', hello, help="Prints Hello, World!") ​ ---------------------------------------------------------------------- ProgVal · 2023-05-08 08:07 This is a bug specific to Python 2 that was [already reported on Hexchat's bugtracker](https://github.com/hexchat/hexchat/issues/2690) and there is [a fix](https://github.com/hexchat/hexchat/commit/6da8f97 e37f1eb57c1dcb9fc094f386385dae22b) that will be part of the next release. So you need to either update Python (preferably, as Python 2 is [deprecated](https://www.python.org/doc/sunset-python-2/) since ages), wait for the next Hexchat release, or build Hexchat yourself from Git. ---------------------------------------------------------------------- Fuddy-D · 2023-05-08 08:48 Thank you! At one point in this process I had deleted python 2.7 and installed python 3.11. I did that again just now, and I still couldn't get my script to run. But I now think Hexchat requires Python 3.6 or maybe it was just looking in the wrong place for "hcpython3.dll". Anyway, I deleted both Python2 and Python3 from my system, and then reinstalled HexChat. This time I let the HexChat installer install Python3 itself (it installs 3.6). After that, everything worked! I do really appreciate your quick response. I was pulling my hair out trying to understand what I was doing wrong!