Unable to install

Hello all,

Having issues trying to install Home Assistant. I’ve tried following the tutorials, but keep running into the following error:

C:\Users\###>py -m homeassistant --open-ui
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\###\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\spawn.py", line 106, in spawn_main
    exitcode = _main(fd)
  File "C:\Users\###\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\spawn.py", line 116, in _main
    self = pickle.load(from_parent)
AttributeError: Can't get attribute 'setup_and_run_hass' on <module '__main__' (built-in)>

If someone could point me in the right direction that would be appreciated.

So your command is py-m homeassistant --open-ui

I am not a python ace, but why don’t you use as displayed on the site ?

pip3 install homeassistant
hass --open-ui

I also see you are using windows. Me too. I remember pip install going wrong having to install a pre-compiled library… Maybe this helps ?

[quote=“sanders”]So your command is py-m homeassistant --open-ui

I am not a python ace, but why don’t you use as displayed on the site ?

pip3 install homeassistant hass --open-ui [/quote]

Those commands wouldnt work, so I followed the ones in the video tutorial.

How do I install the precompiled library?

You are right. Pip3 command doesn’t work. Use pip instead.
First you should check whether you have python3 installed.
Use pip and watch if all goes well. If not check what library gives you problems and let me know
Are you familiar with virtualenv?

Were you able to get this resolved? I’m coming up with the same exact error. I followed the same video instructions for Windows 10.

You can run:python3 -m ensurepip to ensure that pip3 gets installed properly. If you have both python2 & 3, then pip will typically install into python2.

Hi,

Sorry, not meaning to hijack your case.
I am experiencing the same issues I think.

Tried installing this on Windows 2012 server and Windows 10 with same issues.
Followd the guide on the HomeAssistant home page and the Youtube video, without any luck.

Please see my error message.

C:\Windows\system32>python -m homeassistant --open-ui
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\lib\site-packages\homeassistant\__main__.py", line 12, in <
odule>
    from homeassistant import bootstrap
  File "C:\Python27\lib\site-packages\homeassistant\bootstrap.py", line 19, in
module>
    import homeassistant.core as core
  File "C:\Python27\lib\site-packages\homeassistant\core.py", line 13, in <modu
e>
    from types import MappingProxyType
ImportError: cannot import name MappingProxyType

I ended up creating a VM in Hyper-V with Ubuntu.
Worked will after install.

[quote=“alfjonny”]Hi,

Sorry, not meaning to hijack your case.
I am experiencing the same issues I think.

Tried installing this on Windows 2012 server and Windows 10 with same issues.
Followd the guide on the HomeAssistant home page and the Youtube video, without any luck.

Please see my error message.

C:\Windows\system32>python -m homeassistant --open-ui
Traceback (most recent call last):
File “C:\Python27\lib\runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “C:\Python27\lib\runpy.py”, line 72, in run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\homeassistant_main
.py", line 12, in <
odule>
from homeassistant import bootstrap
File “C:\Python27\lib\site-packages\homeassistant\bootstrap.py”, line 19, in
module>
import homeassistant.core as core
File “C:\Python27\lib\site-packages\homeassistant\core.py”, line 13, in
from types import MappingProxyType
ImportError: cannot import name MappingProxyType[/quote]

Hmm… Tried this on Windows 10 myself. If I have time, I might try created a VM to check out this software.

You’re also using Python 2.7 instead of the required Python 3.5

[quote=“alfjonny”]Hi,

Sorry, not meaning to hijack your case.
I am experiencing the same issues I think.

Tried installing this on Windows 2012 server and Windows 10 with same issues.
Followd the guide on the HomeAssistant home page and the Youtube video, without any luck.

Please see my error message.

C:\Windows\system32>python -m homeassistant --open-ui
Traceback (most recent call last):
File “C:\Python27\lib\runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “C:\Python27\lib\runpy.py”, line 72, in run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\homeassistant_main
.py", line 12, in <
odule>
from homeassistant import bootstrap
File “C:\Python27\lib\site-packages\homeassistant\bootstrap.py”, line 19, in
module>
import homeassistant.core as core
File “C:\Python27\lib\site-packages\homeassistant\core.py”, line 13, in
from types import MappingProxyType
ImportError: cannot import name MappingProxyType[/quote]

You’re on Python 2.7
You need Python 3.4 or higher

[quote=“sanders”][quote=“alfjonny”]Hi,

Sorry, not meaning to hijack your case.
I am experiencing the same issues I think.

Tried installing this on Windows 2012 server and Windows 10 with same issues.
Followd the guide on the HomeAssistant home page and the Youtube video, without any luck.

Please see my error message.

C:\Windows\system32>python -m homeassistant --open-ui
Traceback (most recent call last):
File “C:\Python27\lib\runpy.py”, line 162, in _run_module_as_main
main”, fname, loader, pkg_name)
File “C:\Python27\lib\runpy.py”, line 72, in run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\homeassistant_main
.py", line 12, in <
odule>
from homeassistant import bootstrap
File “C:\Python27\lib\site-packages\homeassistant\bootstrap.py”, line 19, in
module>
import homeassistant.core as core
File “C:\Python27\lib\site-packages\homeassistant\core.py”, line 13, in
from types import MappingProxyType
ImportError: cannot import name MappingProxyType[/quote]

You’re on Python 2.7
You need Python 3.4 or higher[/quote]

I’m running Python 3.5.1 and it is still failing on Windows 10.

Best bet is to start over. If you aren’t using it for anything else, completely remove any instances of Python on your machine (uninstall, delete folders, etc). The fact that it is referencing “C:\Python27…” means that it is trying to use version 2.7 most likely.

This is exceedingly frustrating.

Just did an install on a clean win10 machine. Hope this helps:

install python 3.5 (make sure the path is added. Mark the checkbox !)

execute: python -m venv hass (when in your user folder for example)
goto hass/scripts

execute: activate (You have now activated the hass virtual environment.)
execute: pip install homeassistant (Watch for any errors to come by. I didn’t see any.)
execute: hass (Hass will start and try to install additional packages.)

By default it will try to install netdisco. This will result in an error. You need the netifaces package installed.

download the .whl file from here. (I downloaded the 32 bit version.)
lfd.uci.edu/~gohlke/pythonlibs/#netifaces

execute: (type in the command prompt)
pip install

pip install netdisco (just to be sure.)

hass (It could fail with a json error. A restart of hass did solve this.)

[quote=“sanders”]Just did an install on a clean win10 machine. Hope this helps:

install python 3.5 (make sure the path is added. Mark the checkbox !)

execute: python -m venv hass (when in your user folder for example)
goto hass/scripts

execute: activate (You have now activated the hass virtual environment.)
execute: pip install homeassistant (Watch for any errors to come by. I didn’t see any.)
execute: hass (Hass will start and try to install additional packages.)

By default it will try to install netdisco. This will result in an error. You need the netifaces package installed.

download the .whl file from here. (I downloaded the 32 bit version.)
lfd.uci.edu/~gohlke/pythonlibs/#netifaces

execute: (type in the command prompt)
pip install

pip install netdisco (just to be sure.)

hass (It could fail with a json error. A restart of hass did solve this.)[/quote]

Excellent! I’m in business.

@Alfjonny you seem to be using Python 2.7. Home Assistant requires at least Python 3.4

In case anybody stumbles upon this because of this issue, I was able to solve it by running
hass
rather than
py -m homeassistant

Hey guys, I hate to revive and old topic, but I’m having this same issue

Was able to do all the steps @sanders stated except running HASS. I get this error:

C:\Python34>hass
Traceback (most recent call last):
File “c:\python34\lib\runpy.py”, line 193, in run_module_as_main
main”, mod_spec)
File “c:\python34\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Python34\Scripts\hass.exe_main
.py", line 9, in
File "c:\python34\lib\site-packages\homeassistant_main
.py", line 359, in main
monkey_patch_asyncio()
File “c:\python34\lib\site-packages\homeassistant_main_.py”, line 58, in monkey_patch_asyncio
asyncio.tasks.Task._all_tasks = IgnoreCalls()
TypeError: can’t set attributes of built-in/extension type ‘_asyncio.Task’

1 Like