From c73525a709d59d1c11c900dee92a58f33731f247 Mon Sep 17 00:00:00 2001 From: hybridparadigm <47954342+hybridparadigm@users.noreply.github.com> Date: Tue, 26 Feb 2019 22:52:58 -0600 Subject: [PATCH] Updates for python36 and scl (#8721) * Updates for python36 and scl Latest changes to installing the scl environment don't include the scl command, scl-utils is needed along w/ the proper repository in Centos7 to be enabled via RH and then downloaded to the environment which you are building and then SCL commands will work and setting python environment for bash will work too. * Minor changes --- source/_docs/installation/centos.markdown | 27 ++++++++++++++++------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/source/_docs/installation/centos.markdown b/source/_docs/installation/centos.markdown index 912586e509a..4b3364ec44b 100644 --- a/source/_docs/installation/centos.markdown +++ b/source/_docs/installation/centos.markdown @@ -11,37 +11,48 @@ footer: true To run Python 3.x on [CentOS](https://www.centos.org/) or RHEL (Red Hat Enterprise Linux), [Software Collections](https://www.softwarecollections.org/en/scls/rhscl/rh-python36/) needs to be activated first. -You must install Python 3.5.3 or later. Software Collections version of Python 3.5 is 3.5.1 so this guide uses Python 3.6. - ### {% linkable_title Using Software Collections %} -First of all install the software collection repository as root. For example, on CentOS: +First of all install the software collection repository as root and [scl utils](https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/1/html-single/Software_Collections_Guide/). For example, on CentOS: ```bash -$ yum install centos-release-scl +$ sudo yum install centos-release-scl +$ sudo yum-config-manager --enable centos-sclo-rh-testing +$ sudo yum install -y scl-utils ``` Install some dependencies you'll need later. ```bash -$ yum install gcc gcc-c++ systemd-devel +$ sudo yum install gcc gcc-c++ systemd-devel ``` -Then install the Python 3.6 package: +Then install the Python 3.6 package. If you are using CentOS 7 then you may have to install the packages for Python 3.6 using RHEL Methods listed here: https://www.softwarecollections.org/en/scls/rhscl/rh-python36/) for this to work as mentioned above. + +```bash +$ sudo yum install rh-python36 +``` + +This is part of the slight change when trying to install Python 3.6 and running the command `python36 --version` which will after install give you the correct version, but won't allow you to set the software collection using the `scl` command. This command downloads the RH collection of Python to allow you to run `scl` command to enable the environment in `bash` and then run the automate command using the template. ```bash $ yum install rh-python36 ``` -Once installed, switch to your `homeassistant` user (if you've set one up), enable the software collection and check that it has set up the new version of Python: +### {% linkable_title Start using software collections %} ```bash $ scl enable rh-python36 bash +``` + +Once installed, switch to your `homeassistant` user (if you've set one up), enable the software collection and check that it has set up the new version of Python: + +```bash $ python --version Python 3.6.3 ``` -You will be in a command shell set up with Python 3.6 as your default version. The virtualenv and pip commands will be correct for this version, so you can now create a virtual environment and install Home Assistant following the main [instructions](/docs/installation/virtualenv/#step-4-set-up-the-virtualenv). +You will be in a command shell set up with Python 3.6 as your default version. The `virtualenv` and `pip` commands will be correct for this version, so you can now create a virtual environment and install Home Assistant following the main [instructions](/docs/installation/virtualenv/#step-4-set-up-the-virtualenv). You will need to enable the software collection each time you log on before you activate your virtual environment.