TRADRFI - Could not install all requirements

Hey guys,
I am having some problems with the tradfri component.
My log shows me:

Could not install all requirements

Component Wiki told me:

The Python version 3.4.4 or greater is required for this component. The component will not initialize without this and will report a Could not install all requirements error in the logs.

My terminal tells me:

/homeassistant$ python3 -V
Python 3.5.2

However - i tried to set up the newest version, but I am getting some errors and don’t know from here:

sudo apt-get install python 3.6.3
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libghc-filemanip-prof-0.3.6.3-aca98’ for regex ‘3.6.3’
Note, selecting ‘libghc-tasty-kat-prof-0.0.3-6f3f2’ for regex ‘3.6.3’
Note, selecting ‘libghc-tagsoup-dev-0.13.6-346bc’ for regex ‘3.6.3’
Note, selecting ‘libghc-sandi-dev-0.3.6-3e3a8’ for regex ‘3.6.3’
Note, selecting ‘libpipebang-camlp4-dev-3g6t3’ for regex ‘3.6.3’
Note, selecting ‘libghc-filemanip-dev-0.3.6.3-01d51:i386’ for regex ‘3.6.3’
Note, selecting ‘libghc-sandi-prof-0.3.6-3e3a8’ for regex ‘3.6.3’
Note, selecting ‘libghc-tasty-kat-dev-0.0.3-6f3f2’ for regex ‘3.6.3’
Note, selecting ‘libghc-filemanip-dev-0.3.6.3-aca98’ for regex ‘3.6.3’
Note, selecting ‘libghc-tagsoup-prof-0.13.6-346bc’ for regex ‘3.6.3’
Note, selecting ‘fp-units-i386-3.0.0:i386’ for regex ‘3.6.3’
Note, selecting ‘libghc-filemanip-prof-0.3.6.3-01d51:i386’ for regex ‘3.6.3’
Note, selecting ‘libghc-filemanip-dev’ instead of ‘libghc-filemanip-dev-0.3.6.3-aca98’
Note, selecting ‘libghc-filemanip-prof’ instead of ‘libghc-filemanip-prof-0.3.6.3-aca98’
Note, selecting ‘libghc-tagsoup-dev’ instead of ‘libghc-tagsoup-dev-0.13.6-346bc’
Note, selecting ‘libghc-tagsoup-prof’ instead of ‘libghc-tagsoup-prof-0.13.6-346bc’
Note, selecting ‘libghc-sandi-dev’ instead of ‘libghc-sandi-dev-0.3.6-3e3a8’
Note, selecting ‘libghc-sandi-prof’ instead of ‘libghc-sandi-prof-0.3.6-3e3a8’
Note, selecting ‘libghc-tasty-kat-dev’ instead of ‘libghc-tasty-kat-dev-0.0.3-6f3f2’
Note, selecting ‘libghc-tasty-kat-prof’ instead of ‘libghc-tasty-kat-prof-0.0.3-6f3f2’
Note, selecting ‘libpipebang-camlp4-dev’ instead of ‘libpipebang-camlp4-dev-3g6t3’
Note, selecting ‘libghc-filemanip-dev:i386’ instead of ‘libghc-filemanip-dev-0.3.6.3-01d51:i386’
Note, selecting ‘libghc-filemanip-prof:i386’ instead of ‘libghc-filemanip-prof-0.3.6.3-01d51:i386’
python is already the newest version (2.7.11-1).
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libghc-filemanip-dev : Depends: libghc-base-dev-4.8.2.0-0d6d1
Depends: libghc-bytestring-dev-0.10.6.0-9a873
Depends: libghc-directory-dev-1.2.2.0-660a7
Depends: libghc-filepath-dev-1.4.0.0-f97d1
Depends: libghc-mtl-dev-2.2.1-3af90
Depends: libghc-unix-compat-dev-0.4.1.4-1e201
Conflicts: libghc-filemanip-dev:i386 but 0.3.6.3-4 is to be installed
libghc-filemanip-dev:i386 : Depends: libghc-base-dev-4.8.2.0-a3ce8:i386
Depends: libghc-bytestring-dev-0.10.6.0-89a6f:i386
Depends: libghc-directory-dev-1.2.2.0-97fb5:i386
Depends: libghc-filepath-dev-1.4.0.0-59267:i386
Depends: libghc-mtl-dev-2.2.1-05005:i386
Depends: libghc-unix-compat-dev-0.4.1.4-cdf42:i386
Conflicts: libghc-filemanip-dev but 0.3.6.3-4 is to be installed
libghc-filemanip-prof : Depends: libghc-base-prof-4.8.2.0-0d6d1
Depends: libghc-bytestring-prof-0.10.6.0-9a873
Depends: libghc-directory-prof-1.2.2.0-660a7
Depends: libghc-filepath-prof-1.4.0.0-f97d1
Depends: libghc-mtl-prof-2.2.1-3af90
Depends: libghc-unix-compat-prof-0.4.1.4-1e201
Conflicts: libghc-filemanip-prof:i386 but 0.3.6.3-4 is to be installed
libghc-filemanip-prof:i386 : Depends: libghc-base-prof-4.8.2.0-a3ce8:i386
Depends: libghc-bytestring-prof-0.10.6.0-89a6f:i386
Depends: libghc-directory-prof-1.2.2.0-97fb5:i386
Depends: libghc-filepath-prof-1.4.0.0-59267:i386
Depends: libghc-mtl-prof-2.2.1-05005:i386
Depends: libghc-unix-compat-prof-0.4.1.4-cdf42:i386
Conflicts: libghc-filemanip-prof but 0.3.6.3-4 is to be installed
libghc-sandi-dev : Depends: libghc-base-dev-4.8.2.0-0d6d1
Depends: libghc-bytestring-dev-0.10.6.0-9a873
Depends: libghc-conduit-dev-1.2.6.1-41894
Depends: libghc-exceptions-dev-0.8.0.2-36aed
libghc-sandi-prof : Depends: libghc-base-prof-4.8.2.0-0d6d1
Depends: libghc-bytestring-prof-0.10.6.0-9a873
Depends: libghc-conduit-prof-1.2.6.1-41894
Depends: libghc-exceptions-prof-0.8.0.2-36aed
libghc-tagsoup-dev : Depends: libghc-base-dev-4.8.2.0-0d6d1
Depends: libghc-bytestring-dev-0.10.6.0-9a873
Depends: libghc-containers-dev-0.5.6.2-59326
Depends: libghc-network-dev-2.6.2.1-25f4f
Depends: libghc-text-dev-1.2.2.0-2c09c
libghc-tagsoup-prof : Depends: libghc-base-prof-4.8.2.0-0d6d1
Depends: libghc-bytestring-prof-0.10.6.0-9a873
Depends: libghc-containers-prof-0.5.6.2-59326
Depends: libghc-network-prof-2.6.2.1-25f4f
Depends: libghc-text-prof-1.2.2.0-2c09c
libghc-tasty-kat-dev : Depends: libghc-base-dev-4.8.2.0-0d6d1
Depends: libghc-bytestring-dev-0.10.6.0-9a873
Depends: libghc-tasty-dev-0.11.0.2-d0fc9
libghc-tasty-kat-prof : Depends: libghc-base-prof-4.8.2.0-0d6d1
Depends: libghc-bytestring-prof-0.10.6.0-9a873
Depends: libghc-tasty-prof-0.11.0.2-d0fc9
libpipebang-camlp4-dev : Depends: camlp4 but it is not going to be installed
Depends: libcamlp4-ocaml-dev-p9wj7
Depends: ocaml-nox-4.02.3
E: Unable to correct problems, you have held broken packages.

Has anyone encountered similar problems or can tell me how I can fix this?
I am running my instance on Ubuntu 16.04.3, homeassistant in Python virtual environment.

Thank you!

I followed this guide to install python 3.6 on ubuntu 16.04.
After that, set up a new venv like stated here.
Tradfri needed manual install of cython in the venv.
pip3 install Cython

Thank you very much VDRainer and martijnm,

I tried both of your solutions - I managed to install python 3.6.3 but it could not solve my issue unfortunately - still same errors… :frowning:
I guess I have to get rid of those “broken packages” or fix them somehow.

E: Unable to correct problems, you have held broken packages.

My Google excourses give me possible solutions:

apt-mark showhold
sudo apt-mark unhold

but showhold gives me no output.

Second solution:
using aptitude

sudo aptitude install myNewPackage

also no help.
I have no clue.

I will try to setup a new VM an fresh install.
Maybe that helps…

I managed to fix my broken packages!
Thats good again for now!

But HA still cant install these dependencies…

Any Ideas here?

Unable to install package pytradfri[async]==4.1.0: Command “/home/smartassi/homeassistant/bin/python -u -c “import setuptools, tokenize;file=‘/tmp/pip-build-pkiij55e/DTLSSocket/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-2n88wpfe-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/smartassi/homeassistant/include/site/python3.6/DTLSSocket” failed with error code 1 in /tmp/pip-build-pkiij55e/DTLSSocket/

In case anyone encounters the same problem - I now managed to fix it!
There was a problem with the installed python version 3.6.3.
I had to recompile and install it.
For that I followed instructions from:

Thus running command:

apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev

Thereafter I downloaded and untared python3.6.3 to my homefolder:

cd ~
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz
tar xf Python-3.6.3.tar.xz

Then compiled it with options:

./configure --enable-optimizations --enable-loadable-sqlite-extensions
make
sudo make install

Hope that this can help you!

Thanks for all other help I got.
Greetings Walter