2

I am trying to install CEC pip install cec but I am unable to do so. I get the following error:

(venv) pi@MyPi3:~/my_projects_pi $ pip install cec
Collecting cec
  Using cached cec-0.2.5.tar.gz
Building wheels for collected packages: cec
  Running setup.py bdist_wheel for cec ... error
  Complete output from command /home/pi/my_projects_pi/venv/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-x_spz_uj/cec/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/tmpbf7nltz9pip-wheel- --python-tag cp34:
  running bdist_wheel
  running build
  running build_ext
  building 'cec' extension
  creating build
  creating build/temp.linux-armv7l-3.4
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.4m -I/home/pi/my_projects_pi/venv/include/python3.4m -c cec.cpp -o build/temp.linux-armv7l-3.4/cec.o
  cec.cpp: In function ‘PyObject* set_stream_path(PyObject*, PyObject*)’:
  cec.cpp:411:25: error: ‘PyInt_Check’ was not declared in this scope
         if(PyInt_Check(arg)) {
                           ^
  cec.cpp:412:39: error: ‘PyInt_AsLong’ was not declared in this scope
            long arg_l = PyInt_AsLong(arg);
                                         ^
  cec.cpp:420:35: error: ‘PyString_Check’ was not declared in this scope
         } else if(PyString_Check(arg)) {
                                     ^
  cec.cpp:421:46: error: ‘PyString_AsString’ was not declared in this scope
            char * arg_s = PyString_AsString(arg);
                                                ^
  cec.cpp: In function ‘PyObject* initcec()’:
  cec.cpp:671:7: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
         return;
         ^
  cec.cpp:681:31: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
      if(PyType_Ready(dev) < 0 ) return;
                                 ^
  cec.cpp:683:50: error: ‘Py_InitModule’ was not declared in this scope
      PyObject * m = Py_InitModule("cec", CecMethods);
                                                    ^
  cec.cpp:685:20: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
      if( m == NULL ) return;
                      ^
  error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for cec
  Running setup.py clean for cec
Failed to build cec
Installing collected packages: cec
  Running setup.py install for cec ... error
    Complete output from command /home/pi/my_projects_pi/venv/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-x_spz_uj/cec/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-44cdj2l0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/my_projects_pi/venv/include/site/python3.4/cec:
    running install
    running build
    running build_ext
    building 'cec' extension
    creating build
    creating build/temp.linux-armv7l-3.4
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Iinclude -I/usr/include/python3.4m -I/home/pi/my_projects_pi/venv/include/python3.4m -c cec.cpp -o build/temp.linux-armv7l-3.4/cec.o
    cec.cpp: In function ‘PyObject* set_stream_path(PyObject*, PyObject*)’:
    cec.cpp:411:25: error: ‘PyInt_Check’ was not declared in this scope
           if(PyInt_Check(arg)) {
                             ^
    cec.cpp:412:39: error: ‘PyInt_AsLong’ was not declared in this scope
              long arg_l = PyInt_AsLong(arg);
                                           ^
    cec.cpp:420:35: error: ‘PyString_Check’ was not declared in this scope
           } else if(PyString_Check(arg)) {
                                       ^
    cec.cpp:421:46: error: ‘PyString_AsString’ was not declared in this scope
              char * arg_s = PyString_AsString(arg);
                                                  ^
    cec.cpp: In function ‘PyObject* initcec()’:
    cec.cpp:671:7: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
           return;
           ^
    cec.cpp:681:31: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
        if(PyType_Ready(dev) < 0 ) return;
                                   ^
    cec.cpp:683:50: error: ‘Py_InitModule’ was not declared in this scope
        PyObject * m = Py_InitModule("cec", CecMethods);
                                                      ^
    cec.cpp:685:20: error: return-statement with no value, in function returning ‘PyObject* {aka _object*}’ [-fpermissive]
        if( m == NULL ) return;
                        ^
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/pi/my_projects_pi/venv/bin/python3.4 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-x_spz_uj/cec/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-44cdj2l0-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/pi/my_projects_pi/venv/include/site/python3.4/cec" failed with error code 1 in /tmp/pip-build-x_spz_uj/cec/

If anyone has seen this and can help me figure this out it would be appreciated.

I am trying to turn my TV on/off using Raspberry Pi 3 but so far this is the last step that is not working. I also installed Python 3.4 in the Virtualenv. It looks like it is unable to build the wheel for cec.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.