Python 2.7: No module named hexchat

1.2k Views Asked by At

I'm trying to write a Python script that does something with the inputs from the IRC chat that is connected to twitch.

However, when I do import hexchat, python keeps telling me there is no module named hexchat. I'm using Pycharm btw. I just want to be able to use the functionality in the hexchat module. Any help would be appreciated!

3

There are 3 best solutions below

0
On

I was having this issue on Windows 10 but I managed to resolve it by loading .py scripts in Hexchat like the below:

/py load "C:\where\your\file\is.py"

You also want to have module info in your .py file too otherwise Hexchat will complain:

__module_name__ = "helloworld"
__module_version__ = "1.0"
__module_description__ = "Python module example"
6
On

You load scripts inside hexchat. Window > Plugins and Scripts > Load.

0
On

You need to first download and install Hex Chat module from here Downloads and then do the import hexchat.

For Linux - sudo apt-get install hexchat

Documentation for Python API is here Documentation