Setup Alexa echo skill - error during the installation - solved

I’m trying to setup the Alexa skill on my Vero 4K as described in GitHub - m0ngr31/kanzi: Alexa skill for controlling Kodi

However, in one of the last steps I get an error which I haven’t been able to resolve yet. It’s where you run the pip install -r requirements.txt command from the virtual environment. The output ends with:

Running setup.py (path:/tmp/pip-build-ZQzekM/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: python_version < ‘3’
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < ‘3’

So it doesn’t seem to like the Python version. The skill requires Python 2.7 which seems to be installed so I’m not sure why this is going wrong. Does anyone know how to resolve this? Thanks!

Maybe by defaul pip was installed for python 3 and pip command runs pip for python 3?
Try to execute: pip -V and it shows python version.

Also try: pip2 -V

Pip reports:

pip 1.5.6 from /home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages (python 2.7)

Both commands give the same output. Thanks!

Maybe try to manualy install cryptography packege.
sudo pip install cryptography

I think that the requirements.txt file already tries to do that, because this command fails with exactly the same error.

(venv)osmc@osmc-woonkamer:~/.kodi/userdata$ sudo pip install cryptography
Downloading/unpacking cryptography
Downloading cryptography-2.1.4.tar.gz (441kB): 441kB downloaded
Running setup.py (path:/tmp/pip-build-TUx5Kw/cryptography/setup.py) egg_info for package cryptography
error in cryptography setup command: Invalid environment marker: python_version < ‘3’
Complete output from command python setup.py egg_info:
error in cryptography setup command: Invalid environment marker: python_version < ‘3’


Cleaning up…
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-TUx5Kw/cryptography
Storing debug log for failur> e in /root/.pip/pip.log

And this is from the PIP log, not very helpful…

InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-TUx5Kw/cryptography

I have the same error when install cryptography. But then I’ve tried to execute:
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo pip install cryptography
It still can’t install cryptography, but with another error.

No working compiler found, or bogus compiler options passed to
        the compiler from Python's standard "distutils" module.  See
        the error messages above.  Likely, the problem is not related
        to CFFI but generic to the setup.py of any Python package that
        tries to compile C code.  (Hints: on OS/X 10.8, for errors about
        -mno-fused-madd see http://stackoverflow.com/questions/22313407/
        Otherwise, see https://wiki.python.org/moin/CompLangPython or
        the IRC channel #python on irc.freenode.net.)

I’ve tried also to install:
sudo apt-get install python-dev libffi-dev
But still error when cryptography install

I’ve also tried updating as most threads suggest, in my case with

sudo pip install -U pip setuptools

It also ends with compiler not found after retrying the install:

unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory
unable to execute 'arm-linux-gnueabihf-gcc': No such file or directory

Ok also need to install:
sudo apt-get install build-essential
sudo apt-get install libssl-dev
And then cryptography should install ok.

Summary:
sudo pip install --upgrade pip
sudo pip install --upgrade setuptools
sudo apt-get install python-dev libffi-dev build-essential libssl-dev
sudo pip install cryptography

1 Like

Thanks for all the help andrewol, the crypto package has installed correctly.

Some steps further in the installation instructions I need to install this: sudo pip install packaging zappa lambda-packages

But the package install stops with a memory error:

Collecting lambda-packages
Downloading lambda_packages-0.19.0.tar.gz (74.1MB)
99% |############################### | 74.1MB 5.2MB/s eta 0:00:01Exception:
Traceback (most recent call last):
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main
status = self.run(options, args)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/commands/install.py”, line 324, in run
requirement_set.prepare_files(finder)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/req/req_set.py”, line 620, in _prepare_file
session=self.session, hashes=hashes)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 821, in unpack_url
hashes=hashes
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 659, in unpack_http_url
hashes)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 882, in _download_http_url
_download_url(resp, link, content_file, hashes)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 603, in _download_url
hashes.check_against_chunks(downloaded_chunks)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/utils/hashes.py”, line 46, in check_against_chunks
for chunk in chunks:
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 571, in written_chunks
for chunk in chunks:
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/utils/ui.py”, line 139, in iter
for x in it:
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/download.py”, line 560, in resp_read
decode_content=False):
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py”, line 357, in stream
data = self.read(amt=amt, decode_content=decode_content)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py”, line 314, in read
data = self._fp.read(amt)
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py”, line 63, in read
self._close()
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py”, line 50, in _close
self.__callback(self.__buf.getvalue())
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py”, line 275, in cache_response
self.serializer.dumps(request, response, body=body),
File “/home/osmc/kodi-alexa/venv/local/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py”, line 87, in dumps
).encode(“utf8”),
MemoryError

On my Vero4K it was installed normaly
osmc@osmc:~$ sudo pip install lambda-packages
Collecting lambda-packages
Downloading lambda_packages-0.19.0.tar.gz (74.1MB)
100% |################################| 74.1MB 3.7kB/s
Installing collected packages: lambda-packages
Running setup.py install for lambda-packages … done
Successfully installed lambda-packages-0.19.0

Maybe you need try to reboot and execute this command:
pip --no-cache-dir install lambda-packages

Thanks again adrewvol! The installation failed, sadly now the next step fails…:unamused:

I succesfully started the virtual environment with virtualenv venv and source venv/bin/activate but running zappa init generates following error:

ClickException: Zappa requires an active virtual environment!

I read zappa init error: "Zappa requires an active virtual environment" · Issue #1030 · Miserlou/Zappa · GitHub and I’ve checked the environment variable but it seems to be OK in my case: VIRTUAL_ENV=/home/osmc/kodi-alexa/venv

Maybe I’ll try editing the cli.py as a suggested… :yum:

EDIT: It’s ugly but editing cli.py to remove the virtual environment check works.

Next step: sudo zappa deploy dev gave a region error. It turned out that it needed to be run without sudo to get the correct .env file (?) to deploy.

Next error:

ParamValidationError: Parameter validation failed:
Invalid type for parameter CreateBucketConfiguration.LocationConstraint, value: None, type: <type ‘NoneType’>, valid types: <type ‘basestring’>

No idea yet, keep on searching … :slight_smile:

EDIT 2: Still not working but some the error when zappa is complaining about the six package missing can be solved by:

pip uninstall six
pip install six

Also, I’ve changed both the owener and the group to OSMC for the kodi-alexa folder.

EDIT3

I solved the error, it turned out that the earlier generated zappa_settings.json file had a null value for the region. I changed it to eu-west-1 - The deployment command now runs succesfully :grinning:

It’s working!! :yum::grinning:

I can really recommend trying it out yourself, the manual explains most things just fine. It also contains some youtube links demoing the possibilities.

With the information provided by andrewvol and some of my findings you should be good to go. Cheers!