Install external package in Blender (python websockets)
You need to have the modules youre planning to use, on the python path where blender looks for the modules. blender comes with its own python installed. browse the blender directory youll find it. This is probably the cacuse.
just copy your python/lib/sitepackages folder on it and I think youll have it done...