Install failing with the AIO installer

I’ve been running HomeAssistant for about 9 months now and am loving it! I unfortunately have been using my “production” instance as my test bed over the same timeframe and decided this weekend it was time to start over clean and fresh. I am running on a Raspberry Pi 3. All of the attempts below followed the same steps prior to running the AIO installer script: write Raspbian img file to my SD card, add ssh file to boot, boot OS on the Pi, SSH to Pi with Putty, run raspi-config and expand filesystem, change password, set locale, set timezone, set keyboard, then reboot, run update/upgrade, reboot again

On my 1st attempt Sunday night (using the January '17 Raspbian Pixel image) everything went fantastic and the AIO installer ran all the way through. Unfortunately I jacked up this build overwriting the new config files with my old ones.

I then started all over again, performed the setup above a 2nd time and had it fail with the message below (this was Monday during the daytime.)

Because of the fail, I tried again tonight with the Jan '17 Raspbian Lite img. This too failed at the same point.

Are others running clean installs with the AIO installer running into the same issue? Tried some of the stuff found in other threads that got folks working in December, but I’m still not having sucess.

  Running setup.py install for cffi
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 12, in <module>
        import setuptools.version
      File "/usr/local/lib/python3.4/dist-packages/setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 70, in <module>
        import packaging.version
    ImportError: No module named 'packaging'
    Complete output from command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-zusmmhdm/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-79b8dauv-record/install-record.txt --single-version-externally-managed --compile:
    Traceback (most recent call last):

  File "<string>", line 1, in <module>

  File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 12, in <module>

    import setuptools.version

  File "/usr/local/lib/python3.4/dist-packages/setuptools/version.py", line 1, in <module>

    import pkg_resources

  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 70, in <module>

    import packaging.version

ImportError: No module named 'packaging'

----------------------------------------
Cleaning up...
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip-build-zusmmhdm/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-79b8dauv-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-zusmmhdm/cffi
Storing debug log for failure in /root/.pip/pip.log
Traceback (most recent call last):
  File "/usr/bin/pip3", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 70, in <module>
    import packaging.version
ImportError: No module named 'packaging'
Cloning into 'fabric-home-assistant'...
remote: Counting objects: 271, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 271 (delta 0), reused 0 (delta 0), pack-reused 266
Receiving objects: 100% (271/271), 118.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (154/154), done.
Checking connectivity... done.
hass_rpi_installer.sh: line 129: fab: command not found

Hi, I get exactly the same error msg, except that it didn’t work for me from the first time I’ve unpacked my PI and tried to install HA.

I downloaded the newest Raspbian build
(RASPBIAN JESSIE WITH PIXEL; Version:January 2017; Release date: 2017-01-11; Kernel version:4.4)

Enabled SSH by logging in directly to the PI. Disconnected my keyboard and monitor, and started to use my Pi as intended: SSH to it by Putty.

Ran the raspi-config, set timezone (EU) but left locale on the default setting.

After that I ran the AIO script, which terminated the same way as posted by @hardcore_2031.

I’ve tried it two times, starting from scratch (burning the Rspbian image to the SD card), but with no success.

Not quite a good start, but I trust the community.

I’m getting the same thing, I’ve used the AiO installer successfully before. I’m trying to locate the issue and i’ll let you know if i get it working. So far it seems pip3 is broken on the new Raspbian image.

So I had to run the following to get it to work:

curl https://bootstrap.pypa.io/get-pip.py | sudo python3 ln -s /usr/local/bin/pip3 /usr/bin/pip3

This will uninstall the system version of pip3 and install the official python.org version and then sym-link the new version of pip3 to where the AiO install script is looking for it (it’s hard coded for security reasons I presume)

See here for legitimacy of the get-pip.py python script https://packaging.python.org/installing/#install-pip-setuptools-and-wheel

I haven’t tested this from scratch and it’s about 3am here so let me know how it goes. I’ll put in a bug report on the AiO GitHub page.

cheers

1 Like

Thanks, it solves the problem - except that sudo ln -s /usr/local/bin/pip3 /usr/bin/pip3 had to be ran.

But I didn’t succeed: after 1-2 hours the script unexpectedly restarts my Pi before completing the installation. Unfortunately I didn’t save the installation_report for the first time, but I copied the contents of the terminal screen (installation_report-terminal.txt). After that I restarted the AIO script but it terminated again. This time I saved the whole log (installation_report-2.txt).

Any ideas on this? Do you have the same issue @hardcore_2031?

Thanks,
Ben

Saw these and will be giving it another shot tonight. I’ll update on my success/fail. Thx @mrtips for submitting the bug to the AIO Git!

So my install resulted in a working HASS. @benceb it looks like you are hitting files that are already there from the first failed run so it’s bailing rather than overwriting them, I suggest a fresh start.

For science I have started again with a new fresh install:

Firstly I installed pip3 (which will install python3 and all it’s dependencies) manually and tested that it works, which it did.

sudo apt-get update sudo apt-get install python3-pip

Tested by running sudo pip3 install cryptography which completes successfully.

So then I ran the AiO install which fails in the same way as before and leaves pip3 in a broken state.

wget -Nnv https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh

Waited for it to error out and then I ran:

rm -rf ~/fabric-home-assistant curl https://bootstrap.pypa.io/get-pip.py | sudo python3 sudo ln -s /usr/local/bin/pip3 /usr/bin/pip3 wget -Nnv https://raw.githubusercontent.com/home-assistant/fabric-home-assistant/master/hass_rpi_installer.sh && chown pi:pi hass_rpi_installer.sh && bash hass_rpi_installer.sh

This is now proceeding as normal, I’ll update again later to let you know if it worked.

cheers

3 Likes

This was the ticket and the install finished for me after doing this. I marked this as the solution, as while its not the final fix, it is the workaround we need in the meantime. Thank you!

Someone opened an issue with the devs before I got a chance, I linked this thread into the comments:

My “from scratch” install worked correctly.

cheers

I did it again from the very beginnning and it works now. Great workaround, thanks.

Ben

Same problem on a clean install for me. This workaround seems to have solved things. Thanks!

This is due to aged pip and setup tools packages being unable to build dependencies. By downloading and installing the pip version from get-pip.py you essentially are upgrading the installed version. I am correcting the install scripts to fix this preventing the need to symlink python files which is kludge :wink:

2 Likes

I’ll concede that, but a necessary evil to get around hard coded paths to binaries that are in $PATH none the less :wink:

Running the following will get rid of the sym-link if it’s still there.

sudo find /usr/bin/pip3 -type -l -delete

Thanks for sorting it.

Hi Guys,

I think I did everything as mentioned here above but it still errors out - now in a different way:

Traceback (most recent call last):
  File "/usr/local/bin/fab", line 7, in <module>
from fabric.main import main
  File "/usr/local/lib/python3.4/dist-packages/fabric/main.py", line 13, in <module>
from operator import isMappingType
ImportError: cannot import name 'isMappingType'

This seems to have something to do with compatibility of fabric with python3?

Everything mentioned here is no longer required, the bug has been fixed. Start fresh and run the script normally following the official docs https://github.com/home-assistant/fabric-home-assistant

cheers

2 Likes

just downloaded rasbian lite (maybe that’s the problem). I have the same error at the end. i tried your suggestions but they don’t fix it. I don’t see it in the AIO installer doc, but are there dependencies you should have first?

I had the same problem running rasbian lite. Now i am trying on the full rasbian instal and no erors so far.

ha, me too. it finally got to the password prompt of the install. So now I want to figure out that difference. surely it’s not X11.

So if you’re reading this, don’t use the raspbian lite, use the full version. although now i get to remove x, xfce, and all the other gui applications.

I have another error now, too (raspian lite):

Removing apt-listchanges (2.85.13+nmu1) ...
Processing triggers for man-db (2.7.0.2-5) ...
install: unrecognized option '--upgrade'
Try 'install --help' for more information.
install: unrecognized option '--upgrade'
Try 'install --help' for more information.
install: missing destination file operand after 'pycrypto'
Try 'install --help' for more information.
install: missing destination file operand after 'cryptography'
Try 'install --help' for more information.
install: missing destination file operand after 'packaging'
Try 'install --help' for more information.
install: missing destination file operand after 'appdirs'
Try 'install --help' for more information.
install: missing destination file operand after 'six'
Try 'install --help' for more information.
install: missing destination file operand after 'fabric'
Try 'install --help' for more information.
Cloning into 'fabric-home-assistant'...
remote: Counting objects: 290, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 290 (delta 6), reused 0 (delta 0), pack-reused 275
Receiving objects: 100% (290/290), 130.70 KiB | 0 bytes/s, done.
Resolving deltas: 100% (162/162), done.
Checking connectivity... done.
hass_rpi_installer.sh: line 139: fab: command not found

Where does this come from?

I opened another bug report for this:

It’s because pip isn’t installed by default on raspbian lite and the path to pip is collected before it gets installed by the script.

To work around on raspbian lite just remove the directory fabric-home-assistant from pi’s home directory after the first run and error and run the AiO script again. Everything should complete as normal after that.

cheers

1 Like