Issue running setup.py
Closed this issue · 6 comments
Here is the error I receive when I run setup.py:
Traceback (most recent call last):
File "setup.py", line 3, in
LGparser(['scan'])
NameError: name 'LGparser' is not defined
I tried running using sudo and receive the following error:
Traceback (most recent call last):
File "setup.py", line 1, in
import lgtv
File "/home/pi/GitHub/amazon-alexa-lg-tv/lgtv.py", line 6, in
from LGTV import LGTVScan, LGTVClient, getCommands
File "/home/pi/GitHub/amazon-alexa-lg-tv/LGTV/init.py", line 2, in
from ws4py.client.threadedclient import WebSocketClient
ImportError: No module named ws4py.client.threadedclient
Hi outoftheblue62 , I have looked into your error, and it was quite easy to replicate as python 3+ does not allow the module ws4py to be natively used.
I have updated the readme file for better instructions, and as well changed the setup.py and lgtv.py files to hopefully fix this issue, please try again and let me know if this error persists.
Thank You !
Hi FeLiNa22 - Thank you for responding back so quickly! I've tried installing the requirements.txt file again and running setup.py however I get the same error. I should have stated earlier that I'm running setup.py using Python 2.7.13. The error that I keep encountering is as follows:
Traceback (most recent call last):
File "setup.py", line 1, in
import lgtv
File "/home/pi/GitHub/amazon-alexa-lg-tv/lgtv.py", line 6, in
from LGTV import LGTVScan, LGTVClient, getCommands
File "/home/pi/GitHub/amazon-alexa-lg-tv/LGTV/init.py", line 2, in
from ws4py.client.threadedclient import WebSocketClient
ImportError: No module named ws4py.client.threadedclient
Thanks
Hi outoftheblue62, would it it be possible for you to copy the output in terminal after you install the requirements.
Also you might want to try installing the module separately, using:
--> pip install ws4py
ws4py is already installed, tried installing again and running setup.py, no luck.
Here is the output from installing requirements:
Collecting wakeonlan==0.2.2 (from -r requirements.txt (line 1))
Collecting websocket-client==0.54.0 (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/26/2d/f749a5c82f6192d77ed061a38e02001afcba55fe8477336d26a950ab17ce/websocket_client-0.54.0-py2.py3-none-any.whl
Collecting ws4py from git+https://github.com/Lawouach/WebSocket-for-Python.git#egg=ws4py (from -r requirements.txt (line 3))
Cloning https://github.com/Lawouach/WebSocket-for-Python.git to /tmp/pip-build-k4Czh6/ws4py
Collecting six (from websocket-client==0.54.0->-r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: wakeonlan, six, websocket-client, ws4py
Running setup.py install for ws4py ... done
Successfully installed six-1.12.0 wakeonlan-1.1.6 websocket-client-0.54.0 ws4py-0.5.1
Okay outoftheblue62, I have extensively tested the script in Kali linux today tryin to replicate the same error, message however after I install the requirement the error message dissapears. I believe there can only be two issues here, either the Linux OS you are using does not support the ws4py module or you may possibly need to upgrade your python version to at least 2.7.15+.
Sorry if I am not much help, as this is the first script I have uploaded on github.
I think I managed to resolve this one, I uninstalled ws4py via PIP and downloaded and installed the package direct from GitHub. I also installed websocket via PIP which I don't think was installed previously.
I then ran setup.py without sudo and it worked!
Thanks FeLiNa22!