『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
楼主: 27hh

[进阶教程] 闲置安卓手机安装HA变身智能家居中枢,及网关接入教程

  [复制链接]

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-13 13:42:28 来自手机 | 显示全部楼层
jackwang99 发表于 2018-3-13 12:42
谢谢楼主答复。

如果不理会,“安装 homeassistant 环节,执行 pip3 install -U homeassistant 时,提示 ...

$HOME环境变量问题。请用 -H 参数:
sudo -H pip3 install -U pip
回复

使用道具 举报

6

主题

265

帖子

1497

积分

金牌会员

Rank: 6Rank: 6

积分
1497
金钱
1232
HASS币
0
发表于 2018-3-13 18:54:13 | 显示全部楼层
谢谢分享
回复

使用道具 举报

0

主题

30

帖子

106

积分

注册会员

Rank: 2

积分
106
金钱
76
HASS币
0
发表于 2018-3-13 21:22:33 | 显示全部楼层
1、按照教程,多次尝试。执行到最后,应该有错误。请教错在哪里?
2、请教各位,我是linux小白,多多指点。


* Documentation:  https://help.ubuntu.com/
Ubuntu 16.04 LTS [running via Linux Deploy]
Last login: Tue Mar 13 12:37:51 2018 from 192.168.21.101
android@localhost:~$ sudo apt-get install nano
Reading package lists... Done
Building dependency tree      
Reading state information... Done
nano is already the newest version (2.5.3-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
android@localhost:~$ sudo apt-get install -y python3-pip
Reading package lists... Done
Building dependency tree      
Reading state information... Done
python3-pip is already the newest version (8.1.1-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
android@localhost:~$ sudo mkdir /root/.pip
mkdir: cannot create directory '/root/.pip': File exists
android@localhost:~$ sudo sh -c "echo '[global]\nindex-url = http://mirrors.ustc.edu.cn/pypi/web/simple/' > /root/.pip/pip.conf"
android@localhost:~$ sudo pip3 install -U pip
The directory '/home/android/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/android/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
android@localhost:~$ sudo -H pip install -U pip
The repository located at mirrors.ustc.edu.cn is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirrors.ustc.edu.cn'.
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
android@localhost:~$ sudo -H pip install -U pip --trusted-host mirrors.ustc.edu.cn
Requirement already up-to-date: pip in /usr/local/lib/python3.5/dist-packages
android@localhost:~$ sudo pip3 install virtualenv
The directory '/home/android/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/android/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already satisfied: virtualenv in /usr/local/lib/python3.5/dist-packages
android@localhost:~$ sudo -H pip3 install virtualenv
Requirement already satisfied: virtualenv in /usr/local/lib/python3.5/dist-packages
android@localhost:~$ sudo useradd -rm homeassistant
useradd: user 'homeassistant' already exists
android@localhost:~$ sudo chown homeassistant:homeassistant /srv/homeassistant
android@localhost:~$ sudo mkdir /home/homeassistant/.pip
mkdir: cannot create directory '/home/homeassistant/.pip': File exists
android@localhost:~$ sudo sh -c "echo '[global]nindex-url = https://mirrors.ustc.edu.cn/pypi/web/simple/' > /home/homeassistant/.pip/pip.conf"
android@localhost:~$ sudo chown -R homeassistant:homeassistant /home/homeassistant/.pip
android@localhost:~$ sudo su -s /bin/bash homeassistant
homeassistant@localhost:/home/android$ virtualenv -p python3 /srv/homeassistant
Already using interpreter /usr/bin/python3
Using base prefix '/usr'
New python executable in /srv/homeassistant/bin/python3
Not overwriting existing python script /srv/homeassistant/bin/python (you must use /srv/homeassistant/bin/python3)
Installing setuptools, pip, wheel...done.


回复

使用道具 举报

0

主题

30

帖子

106

积分

注册会员

Rank: 2

积分
106
金钱
76
HASS币
0
发表于 2018-3-13 21:23:37 | 显示全部楼层
MAPGPS 发表于 2018-3-13 13:42
$HOME环境变量问题。请用 -H 参数:
sudo -H pip3 install -U pip

麻烦高手,指点一下。谢谢
回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-13 23:08:46 | 显示全部楼层
jackwang99 发表于 2018-3-13 21:22
1、按照教程,多次尝试。执行到最后,应该有错误。请教错在哪里?
2、请教各位,我是linux小白,多多指点。 ...

你那里头有两套python3了,如果都是新的话倒也没关系。
接着往下,继续安装吧!
回复

使用道具 举报

1

主题

27

帖子

85

积分

注册会员

Rank: 2

积分
85
金钱
58
HASS币
0
发表于 2018-3-13 23:55:53 | 显示全部楼层
楼主能否在后面抄代码的地方截下每一步安装成功的图,我都不知道哪里出了问题
回复

使用道具 举报

0

主题

11

帖子

86

积分

注册会员

Rank: 2

积分
86
金钱
75
HASS币
0
发表于 2018-3-14 00:09:08 | 显示全部楼层
谢谢分享,小白来学习了
回复

使用道具 举报

0

主题

30

帖子

106

积分

注册会员

Rank: 2

积分
106
金钱
76
HASS币
0
发表于 2018-3-14 16:03:46 | 显示全部楼层
小白请教,谢谢:

问题1:看截图1,linux Deploy,安装是否成功?
问题2:在2.2.1准备时,执行sudoapt-get install -y python3-pip,提示:E: Unable to locatepackage python3-pip,错在哪里?
--------------------------------------截图1-----------
Screenshot_20180314-155254.png
------------------------------------------------Xshell5 ------
Connecting to 192.168.21.102:22...
Connection established.
To escape to local shell, press'Ctrl+Alt+]'.
Welcome to Ubuntu 16.04 LTS (GNU/Linux3.4.0-perf-g6f3bfd0 armv7l)
*Documentation:  https://help.ubuntu.com/
Ubuntu 16.04 LTS [running via Linux Deploy]
Last login: Wed Mar 14 15:29:33 2018 from192.168.21.100
android@localhost:~$ python3 -V
Python 3.5.1+
android@localhost:~$ sudo apt-get install-y python3-pip
Reading package lists... Done
Building dependency tree      
Reading state information... Done
E: Unable to locatepackage python3-pip
android@localhost:~$

回复

使用道具 举报

3

主题

159

帖子

587

积分

高级会员

Rank: 4

积分
587
金钱
428
HASS币
0
发表于 2018-3-14 17:42:02 | 显示全部楼层
jackwang99 发表于 2018-3-14 16:03
小白请教,谢谢:

问题1:看截图1,linux Deploy,安装是否成功?

1. 你都进Linux系统了,当然安装成功了。
2. 请检查一下1.2步里的“源地址”是否正确。
回复

使用道具 举报

0

主题

1

帖子

16

积分

新手上路

Rank: 1

积分
16
金钱
15
HASS币
0
发表于 2018-3-14 18:37:06 | 显示全部楼层
新手小白  学习了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-24 20:23 , Processed in 0.204670 second(s), 38 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表