Installing python support library on Rpi

First post here, so I appologize if I am adding this to the wrong area.
I have been using OSMC since it’s inception and have had great success with it. Thank you @sam_nazarko. Anyway recently my Rpi performed the October update without any issues but today I discovered something odd that I am 100% certain was working prior to the update. Basically i have some python scripts that control some room lighting when I start a movie (using the cinemavision addon). These python scripts have worked flawlessly for about a year. Today when I attempted to run the scripts they were erroring out with the following error.

osmc@osmc:~/CV/Actions$ python MoviePause.py
Traceback (most recent call last):
File “MoviePause.py”, line 2, in
from websocket import create_connection
ImportError: No module named websocket

This was a surprise, like i said these scripts have been working for a while now without any issues.
To rectify the issue I attempted to install the missing websocket module and it too errored out.
I am hoping someone can help me to get me operational again.

osmc@osmc:~/CV/Actions$ pip install websocket
Collecting websocket
Using cached https://files.pythonhosted.org/packages/f2/6d/a60d620ea575c885510 c574909d2e3ed62129b121fa2df00ca1c81024c87/websocket-0.2.1.tar.gz
Collecting gevent (from websocket)
Using cached https://files.pythonhosted.org/packages/10/c1/9499b146bfa43aa4f1e 0ed1bab1bd3209a4861d25650c11725036c731cf5/gevent-1.3.7.tar.gz
Ignoring cffi: markers ‘sys_platform == “win32” and platform_python_implementa tion == “CPython”’ don’t match your environment
Collecting greenlet (from websocket)
Using cached https://files.pythonhosted.org/packages/f8/e8/b30ae23b45f69aa3f024b46064c0ac8e5fcb4f22ace0dca8d6f9c8bbe5e7/greenlet-0.4.15.tar.gz
Building wheels for collected packages: websocket, gevent, greenlet
Running setup.py bdist_wheel for websocket … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-mYMRZs/websocket/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/tmpAYYhlEpip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]
or: -c --help [cmd1 cmd2 …]
or: -c --help-commands
or: -c cmd --help

error: invalid command ‘bdist_wheel’


Failed building wheel for websocket
Running setup.py clean for websocket
Running setup.py bdist_wheel for gevent … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-mYMRZs/gevent/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/tmpRdJXBSpip-wheel- --python-tag cp27:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘cffi_modules’
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘project_urls’
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]
or: -c --help [cmd1 cmd2 …]
or: -c --help-commands
or: -c cmd --help

error: invalid command ‘bdist_wheel’


Failed building wheel for gevent
Running setup.py clean for gevent
Running setup.py bdist_wheel for greenlet … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-mYMRZs/greenlet/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” bdist_wheel -d /tmp/tmpKu8QI0pip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]
or: -c --help [cmd1 cmd2 …]
or: -c --help-commands
or: -c cmd --help

error: invalid command ‘bdist_wheel’


Failed building wheel for greenlet
Running setup.py clean for greenlet
Failed to build websocket gevent greenlet
Installing collected packages: greenlet, gevent, websocket
Running setup.py install for greenlet … error
Complete output from command /usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-mYMRZs/greenlet/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-Pnn74M-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
building ‘greenlet’ extension
creating build
creating build/temp.linux-armv7l-2.7
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-EEvVvy/python2.7-2.7.13=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c greenlet.c -o build/temp.linux-armv7l-2.7/greenlet.o
unable to execute ‘arm-linux-gnueabihf-gcc’: No such file or directory
error: command ‘arm-linux-gnueabihf-gcc’ failed with exit status 1

----------------------------------------

Command “/usr/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-mYMRZs/greenlet/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(‘\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-Pnn74M-record/install-record.txt --single-version-externally-managed --compile --user --prefix=” failed with error code 1 in /tmp/pip-build-mYMRZs/greenlet/
osmc@osmc:~/CV/Actions$

Try:

sudo apt-get install python-websocket instead.

It’s trying to cross compile. If you really want to build from source.

sudo apt-get update
sudo apt-get install build-essential
export ARCH=arm
export CROSS_COMPILE=/usr/bin/

Cheers

Sam

easybutton

1 Like