android@localhost:~$ sudo pip3 install -U pip
The directory'/home/android/.cache/pip/http' or its parent directory is not owned by thecurrent user and the cache has been disabled. Please check the permissions andowner of that directory. If executing pip with sudo, you may want sudo's -Hflag.
The directory '/home/android/.cache/pip' orits parent directory is not owned by the current user and caching wheels hasbeen disabled. check the permissions and owner of that directory. If executingpip with sudo, you may want sudo's -H flag.
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 239kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.1
Not uninstalling pip at /usr/lib/python3/dist-packages, outsideenvironment /usr
Successfully installed pip-9.0.1
android@localhost:~$ pip3 install -U pip
Requirement already up-to-date: pip in/usr/local/lib/python3.5/dist-packages
android@localhost:~$ pip3 install virtualenv
Collecting virtualenv
Downloading virtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
100% |################################| 1.8MB 193kB/s
Installing collected packages: virtualenv
Exception:
Traceback (most recent call last):
File"/usr/local/lib/python3.5/dist-packages/pip/basecommand.py", line215, in main
status = self.run(options, args)
File "/usr/local/lib/python3.5/dist-packages/pip/commands/install.py",line 342, in run
prefix=options.prefix_path,
File"/usr/local/lib/python3.5/dist-packages/pip/req/req_set.py", line784, in install
**kwargs
File "/usr/local/lib/python3.5/dist-packages/pip/req/req_install.py",line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File"/usr/local/lib/python3.5/dist-packages/pip/req/req_install.py", line1064, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py",line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python3.5/dist-packages/pip/wheel.py",line 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/usr/lib/python3.5/shutil.py", line 115, in copyfile
with open(dst, 'wb') as fdst:
PermissionError: [Errno 13] Permissiondenied: '/usr/local/lib/python3.5/dist-packages/virtualenv.py'
android@localhost:~$ sudo pip3 install virtualenv
The directory'/home/android/.cache/pip/http' or its parent directory is not owned by thecurrent user and the cache has been disabled. Please check the permissions andowner of that directory. If executing pip with sudo, you may want sudo's -Hflag.
The directory '/home/android/.cache/pip' orits parent directory is not owned by the current user and caching wheels hasbeen disabled. check the permissions and owner of that directory. If executingpip with sudo, you may want sudo's -H flag.
Collecting virtualenv
Downloadingvirtualenv-15.1.0-py2.py3-none-any.whl (1.8MB)
100% |################################| 1.8MB 184kB/s
Installing collected packages: virtualenv
Successfully installed virtualenv-15.1.0
android@localhost:~$ python3 -V
Python 3.5.1+
android@localhost:~$ sudo useradd -rm homeassistant
android@localhost:~$ sudo mkdir /srv/homeassistant
android@localhost:~$ sudo chown homeassistant:homeassistant/srv/homeassistant
android@localhost:~$ sudo mkdir /home/homeassistant/.pip
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
Also creating executable in/srv/homeassistant/bin/python
Installing setuptools, pip, wheel...done.
homeassistant@localhost:/home/android$ source/srv/homeassistant/bin/activate
(homeassistant) homeassistant@localhost:/home/android$pip3 install -U homeassistant
Collecting homeassistant
Downloading homeassistant-0.65.4-py2.py3-none-any.whl (7.8MB)
100% |################################| 7.8MB 42kB/s
homeassistant requiresPython '>=3.5.3' but the running Python is 3.5.1