Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save matthiasroos/3c8f1e0265eff6b60f6a7bcf701daa14 to your computer and use it in GitHub Desktop.

Select an option

Save matthiasroos/3c8f1e0265eff6b60f6a7bcf701daa14 to your computer and use it in GitHub Desktop.

Revisions

  1. matthiasroos revised this gist Mar 21, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.6 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Installing Python 3.7.6 on Raspbian Stretch
    ===========================================

    As of January 2020, Raspbian does not yet include any Python release newer than Python 3.5.x. This means we will have to build
    As of January 2020, Raspbian Stretch does not yet include any Python release newer than Python 3.5.x. This means we will have to build
    it ourselves, and here is how to do it.

    1. Install the required build-tools (some might already be installed on your system).
  2. matthiasroos revised this gist Feb 4, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Installing Python 3.7.6 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Installing Python 3.7.6 on Raspbian
    =================================
    Installing Python 3.7.6 on Raspbian Stretch
    ===========================================

    As of January 2020, Raspbian does not yet include any Python release newer than Python 3.5.x. This means we will have to build
    it ourselves, and here is how to do it.
  3. matthiasroos revised this gist Feb 1, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -8,4 +8,4 @@ make -j 4
    sudo make altinstall
    cd ..
    sudo rm -r Python-3.7.6
    rm Python-3.7.4.tar.xz
    rm Python-3.7.6.tar.xz
  4. matthiasroos renamed this gist Feb 1, 2020. 1 changed file with 0 additions and 0 deletions.
  5. matthiasroos revised this gist Feb 1, 2020. 2 changed files with 13 additions and 16 deletions.
    16 changes: 8 additions & 8 deletions Installing Python 3.7.4 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Installing Python 3.7.4 on Raspbian
    Installing Python 3.7.6 on Raspbian
    =================================

    As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build
    As of January 2020, Raspbian does not yet include any Python release newer than Python 3.5.x. This means we will have to build
    it ourselves, and here is how to do it.

    1. Install the required build-tools (some might already be installed on your system).
    @@ -13,14 +13,14 @@ it ourselves, and here is how to do it.
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    2. Download and install Python 3.7.4. When downloading the source code, select the most recent release of Python, available
    2. Download and install Python 3.7.6. When downloading the source code, select the most recent release of Python, available
    on the `official site <https://www.python.org/downloads/source/>`_. Adjust the file names accordingly.

    .. code-block:: bash
    wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
    tar xf Python-3.7.4.tar.xz
    cd Python-3.7.4
    wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
    tar xf Python-3.7.6.tar.xz
    cd Python-3.7.6
    ./configure
    make -j 4
    sudo make altinstall
    @@ -31,8 +31,8 @@ it ourselves, and here is how to do it.

    .. code-block:: bash
    sudo rm -r Python-3.7.4
    rm Python-3.7.4.tar.xz
    sudo rm -r Python-3.7.6
    rm Python-3.7.6.tar.xz
    sudo apt-get --purge remove build-essential tk-dev -y
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    13 changes: 5 additions & 8 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,11 @@
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
    tar xf Python-3.7.4.tar.xz
    cd Python-3.7.4
    wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tar.xz
    tar xf Python-3.7.6.tar.xz
    cd Python-3.7.6
    ./configure
    make -j 4
    sudo make altinstall
    cd ..
    sudo rm -r Python-3.4.0
    rm Python-3.7.4.tar.xz
    sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove -y
    sudo apt-get clean
    sudo rm -r Python-3.7.6
    rm Python-3.7.4.tar.xz
  6. @SeppPenner SeppPenner revised this gist Oct 10, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.4 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ it ourselves, and here is how to do it.
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    2. Download and install Python 3.7.4. When downloading the source code, select the most recent release of Python 3.7.4, available
    2. Download and install Python 3.7.4. When downloading the source code, select the most recent release of Python, available
    on the `official site <https://www.python.org/downloads/source/>`_. Adjust the file names accordingly.

    .. code-block:: bash
  7. @SeppPenner SeppPenner revised this gist Oct 10, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions Installing Python 3.7.4 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -42,13 +42,12 @@ it ourselves, and here is how to do it.
    or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh

    Afterwards, use the python setup by calling
    Afterwards, execute any of your scripts (`yourscript.py` is just a placeholder) using

    .. code-block:: bash
    python3.7 yourscript.py.
    to get the correct python version running.
    This guide is pretty much taken from the following tutorial:
    https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/
  8. @SeppPenner SeppPenner revised this gist Sep 29, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.4 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ it ourselves, and here is how to do it.
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    2. Download and install Python 3.7.4 When downloading the source code, select the most recent release of Python 3.7.4, available
    2. Download and install Python 3.7.4. When downloading the source code, select the most recent release of Python 3.7.4, available
    on the `official site <https://www.python.org/downloads/source/>`_. Adjust the file names accordingly.

    .. code-block:: bash
  9. @SeppPenner SeppPenner revised this gist Sep 29, 2019. 2 changed files with 13 additions and 13 deletions.
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Installing Python 3.7.0 on Raspbian
    Installing Python 3.7.4 on Raspbian
    =================================

    As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build
    As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.4. This means we will have to build
    it ourselves, and here is how to do it.

    1. Install the required build-tools (some might already be installed on your system).
    @@ -13,14 +13,14 @@ it ourselves, and here is how to do it.
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    2. Download and install Python 3.7.0 When downloading the source code, select the most recent release of Python 3.7.0, available
    2. Download and install Python 3.7.4 When downloading the source code, select the most recent release of Python 3.7.4, available
    on the `official site <https://www.python.org/downloads/source/>`_. Adjust the file names accordingly.

    .. code-block:: bash
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
    tar xf Python-3.7.4.tar.xz
    cd Python-3.7.4
    ./configure
    make -j 4
    sudo make altinstall
    @@ -31,8 +31,8 @@ it ourselves, and here is how to do it.

    .. code-block:: bash
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo rm -r Python-3.7.4
    rm Python-3.7.4.tar.xz
    sudo apt-get --purge remove build-essential tk-dev -y
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    10 changes: 5 additions & 5 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
    tar xf Python-3.7.4.tar.xz
    cd Python-3.7.4
    ./configure
    make -j 4
    sudo make altinstall
    cd ..
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo rm -r Python-3.4.0
    rm Python-3.7.4.tar.xz
    sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove -y
    sudo apt-get clean
  10. @SeppPenner SeppPenner revised this gist Apr 28, 2019. 1 changed file with 3 additions and 4 deletions.
    7 changes: 3 additions & 4 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -42,12 +42,11 @@ it ourselves, and here is how to do it.
    or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh

    Afterwards, use the python setup by calling python3.7 yourscript.py.
    Afterwards, use the python setup by calling

    Use e.g.
    .. code-block:: bash
    python3.7 --version
    pip3.7 --version
    python3.7 yourscript.py.
    to get the correct python version running.

  11. @SeppPenner SeppPenner revised this gist Apr 28, 2019. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -44,6 +44,13 @@ or simply copy the setup.sh content to a file called setup.sh, do a chmod +x set

    Afterwards, use the python setup by calling python3.7 yourscript.py.

    Use e.g.

    python3.7 --version
    pip3.7 --version

    to get the correct python version running.

    This guide is pretty much taken from the following tutorial:
    https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/
    and
  12. @SeppPenner SeppPenner revised this gist Jul 6, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -40,7 +40,7 @@ it ourselves, and here is how to do it.
    sudo apt-get autoremove -y
    sudo apt-get clean
    or simply copy the .. highlight:: bash setup.sh .. highlight:: none content to a file called .. highlight:: bash setup.sh .. highlight:: none, do a .. highlight:: bash chmod +x setup.sh .. highlight:: none and execute the script via .. highlight:: bash sudo ./setup.sh .. highlight:: none
    or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh

    Afterwards, use the python setup by calling python3.7 yourscript.py.

  13. @SeppPenner SeppPenner revised this gist Jul 6, 2018. 2 changed files with 4 additions and 22 deletions.
    16 changes: 4 additions & 12 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -25,17 +25,7 @@ it ourselves, and here is how to do it.
    make -j 4
    sudo make altinstall
    3. Make the compiled binaries globally available.

    .. code-block:: bash
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pydoc3.7.0 /usr/bin/pydoc3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7.0 /usr/bin/python3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7.0m /usr/bin/python3.7.0m
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pyvenv-3.7.0 /usr/bin/pyvenv-3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pip3.7.0 /usr/bin/pip3.7.0
    4. Optionally: Delete the source code and uninstall the previously installed packages. When
    3. Optionally: Delete the source code and uninstall the previously installed packages. When
    uninstalling the packages, make sure you only remove those that were not previously installed
    on your system. Also, remember to adjust version numbers if necesarry.

    @@ -50,7 +40,9 @@ it ourselves, and here is how to do it.
    sudo apt-get autoremove -y
    sudo apt-get clean
    or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh
    or simply copy the .. highlight:: bash setup.sh .. highlight:: none content to a file called .. highlight:: bash setup.sh .. highlight:: none, do a .. highlight:: bash chmod +x setup.sh .. highlight:: none and execute the script via .. highlight:: bash sudo ./setup.sh .. highlight:: none

    Afterwards, use the python setup by calling python3.7 yourscript.py.

    This guide is pretty much taken from the following tutorial:
    https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/
    10 changes: 0 additions & 10 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -6,16 +6,6 @@ cd Python-3.7.0
    ./configure
    make -j 4
    sudo make altinstall
    sudo rm /usr/bin/pydoc3
    sudo rm /usr/bin/python3
    sudo rm /usr/bin/python3m
    sudo rm /usr/bin/pyvenv-3
    sudo rm /usr/bin/pip3
    sudo ln -s /usr/local/opt/python-3.7/bin/pydoc3.7 /usr/bin/pydoc3
    sudo ln -s /usr/local/opt/python-3.7/bin/python3.7 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.7/bin/python3.7m /usr/bin/python3m
    sudo ln -s /usr/local/opt/python-3.7/bin/pyvenv-3.7 /usr/bin/pyvenv-3
    sudo ln -s /usr/local/opt/python-3.7/bin/pip3.7 /usr/bin/pip3
    cd ..
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
  14. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -11,11 +11,11 @@ sudo rm /usr/bin/python3
    sudo rm /usr/bin/python3m
    sudo rm /usr/bin/pyvenv-3
    sudo rm /usr/bin/pip3
    sudo ln -s /usr/local/opt/python-3.6/bin/pydoc3.6 /usr/bin/pydoc3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6m /usr/bin/python3m
    sudo ln -s /usr/local/opt/python-3.6/bin/pyvenv-3.6 /usr/bin/pyvenv-3
    sudo ln -s /usr/local/opt/python-3.6/bin/pip3.6 /usr/bin/pip3
    sudo ln -s /usr/local/opt/python-3.7/bin/pydoc3.7 /usr/bin/pydoc3
    sudo ln -s /usr/local/opt/python-3.7/bin/python3.7 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.7/bin/python3.7m /usr/bin/python3m
    sudo ln -s /usr/local/opt/python-3.7/bin/pyvenv-3.7 /usr/bin/pyvenv-3
    sudo ln -s /usr/local/opt/python-3.7/bin/pip3.7 /usr/bin/pip3
    cd ..
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
  15. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -16,8 +16,9 @@ sudo ln -s /usr/local/opt/python-3.6/bin/python3.6 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6m /usr/bin/python3m
    sudo ln -s /usr/local/opt/python-3.6/bin/pyvenv-3.6 /usr/bin/pyvenv-3
    sudo ln -s /usr/local/opt/python-3.6/bin/pip3.6 /usr/bin/pip3
    cd ..
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove
    sudo apt-get autoremove -y
    sudo apt-get clean
  16. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -50,6 +50,8 @@ it ourselves, and here is how to do it.
    sudo apt-get autoremove -y
    sudo apt-get clean
    or simply copy the setup.sh content to a file called setup.sh, do a chmod +x setup.sh and execute the script via sudo ./setup.sh

    This guide is pretty much taken from the following tutorial:
    https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/
    and
  17. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 5 additions and 0 deletions.
    5 changes: 5 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,11 @@ cd Python-3.7.0
    ./configure
    make -j 4
    sudo make altinstall
    sudo rm /usr/bin/pydoc3
    sudo rm /usr/bin/python3
    sudo rm /usr/bin/python3m
    sudo rm /usr/bin/pyvenv-3
    sudo rm /usr/bin/pip3
    sudo ln -s /usr/local/opt/python-3.6/bin/pydoc3.6 /usr/bin/pydoc3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6m /usr/bin/python3m
  18. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 4 changed files with 20 additions and 112 deletions.
    14 changes: 12 additions & 2 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ it ourselves, and here is how to do it.
    .. code-block:: bash
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    @@ -25,6 +25,16 @@ it ourselves, and here is how to do it.
    make -j 4
    sudo make altinstall
    3. Make the compiled binaries globally available.

    .. code-block:: bash
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pydoc3.7.0 /usr/bin/pydoc3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7.0 /usr/bin/python3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7.0m /usr/bin/python3.7.0m
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pyvenv-3.7.0 /usr/bin/pyvenv-3.7.0
    sudo ln -s /usr/local/opt/python-3.7.0/bin/pip3.7.0 /usr/bin/pip3.7.0
    4. Optionally: Delete the source code and uninstall the previously installed packages. When
    uninstalling the packages, make sure you only remove those that were not previously installed
    on your system. Also, remember to adjust version numbers if necesarry.
    @@ -36,7 +46,7 @@ it ourselves, and here is how to do it.
    sudo apt-get --purge remove build-essential tk-dev -y
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove -y
    sudo apt-get clean
    22 changes: 8 additions & 14 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,18 @@
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    ./configure
    make -j 4
    sudo make altinstall

    echo "Do you wish to delete the source code and uninstall all previously installed packages? {Y/N} (Case sensitive!)"
    read ans
    if [ans = "Y"]
    then
    sudo ln -s /usr/local/opt/python-3.6/bin/pydoc3.6 /usr/bin/pydoc3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6 /usr/bin/python3
    sudo ln -s /usr/local/opt/python-3.6/bin/python3.6m /usr/bin/python3m
    sudo ln -s /usr/local/opt/python-3.6/bin/pyvenv-3.6 /usr/bin/pyvenv-3
    sudo ln -s /usr/local/opt/python-3.6/bin/pip3.6 /usr/bin/pip3
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo apt-get --purge remove build-essential tk-dev
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
    sudo apt-get autoremove
    sudo apt-get clean
    else
    echo "Done!"
    fi
    sudo apt-get clean
    51 changes: 0 additions & 51 deletions warningsFromMake.md
    Original file line number Diff line number Diff line change
    @@ -1,51 +0,0 @@
    The warnings I get:

    ```bash
    In file included from ./Include/pytime.h:6:0,
    from ./Include/Python.h:68,
    from Python/hamt.c:1:
    Python/hamt.c: In function âhamt_py_deleteâ:
    ./Include/object.h:800:12: warning: ânew_rootâ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
    ^
    Python/hamt.c:2351:17: note: ânew_rootâ was declared here
    PyHamtNode *new_root;
    ^~~~~~~~
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/structmember.o Python/structmember.c
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/symtable.o Python/symtable.c
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE \
    -DABIFLAGS='"m"' \
    -DMULTIARCH=\"arm-linux-gnueabihf\" \
    -o Python/sysmodule.o ./Python/sysmodule.c
    In file included from ./Include/pytime.h:6:0,
    from ./Include/Python.h:68,
    from Python/hamt.c:1:
    Python/hamt.c: In function â_PyHamt_Withoutâ:
    ./Include/object.h:800:12: warning: ânew_rootâ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
    ^
    Python/hamt.c:2351:17: note: ânew_rootâ was declared here
    PyHamtNode *new_root;
    ^~~~~~~~
    ```
    and
    ```bash
    low = *((UINT32*)(laneAsBytes+0));
    ^~~
    In file included from /home/pi/Python-3.7.0/Modules/_sha3/sha3module.c:113:0:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_AddBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:152:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    low = *((UINT32*)(laneAsBytes+0));
    ^~~
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_ExtractBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:296:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *((UINT32*)(laneAsBytes+0)) = low;
    ^
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_ExtractAndAddBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:369:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *((UINT32*)(laneAsBytes+0)) = low;
    ^
    gcc -pthr
    ```
    45 changes: 0 additions & 45 deletions z_ErrorFromAltinstall.md
    Original file line number Diff line number Diff line change
    @@ -1,45 +0,0 @@
    From

    ```bash
    sudo make altinstall
    ```

    I get the following errors:

    ```bash
    rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_arm-linux-gnueabihf.py
    rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__
    /usr/bin/install -c -m 644 ./Misc/python.man \
    /usr/local/share/man/man1/python3.7.1
    if test "xupgrade" != "xno" ; then \
    case upgrade in \
    upgrade) ensurepip="--altinstall --upgrade" ;; \
    install|*) ensurepip="--altinstall" ;; \
    esac; \
    ./python -E -m ensurepip \
    $ensurepip --root=/ ; \
    fi
    Traceback (most recent call last):
    File "/home/pi/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
    File "/home/pi/Python-3.7.0/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
    File "/home/pi/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    Makefile:1132: die Regel für Ziel âaltinstallâ scheiterte
    make: *** [altinstall] Fehler 1
    ```
  19. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions z_ErrorFromAltinstall.md
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,9 @@ From
    sudo make altinstall
    ```

    I get the folowing errors:
    I get the following errors:

    ```python
    ```bash
    rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_arm-linux-gnueabihf.py
    rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__
    /usr/bin/install -c -m 644 ./Misc/python.man \
  20. @SeppPenner SeppPenner renamed this gist Jul 5, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  21. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 45 additions and 0 deletions.
    45 changes: 45 additions & 0 deletions ErrorFromAltinstall.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    From

    ```bash
    sudo make altinstall
    ```

    I get the folowing errors:

    ```python
    rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_arm-linux-gnueabihf.py
    rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__
    /usr/bin/install -c -m 644 ./Misc/python.man \
    /usr/local/share/man/man1/python3.7.1
    if test "xupgrade" != "xno" ; then \
    case upgrade in \
    upgrade) ensurepip="--altinstall --upgrade" ;; \
    install|*) ensurepip="--altinstall" ;; \
    esac; \
    ./python -E -m ensurepip \
    $ensurepip --root=/ ; \
    fi
    Traceback (most recent call last):
    File "/home/pi/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
    File "/home/pi/Python-3.7.0/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
    File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
    File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
    File "/home/pi/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    Makefile:1132: die Regel für Ziel âaltinstallâ scheiterte
    make: *** [altinstall] Fehler 1
    ```
  22. @SeppPenner SeppPenner renamed this gist Jul 5, 2018. 1 changed file with 23 additions and 1 deletion.
    24 changes: 23 additions & 1 deletion warningsFromMake.txt → warningsFromMake.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    The warnings I get:


    ```bash
    In file included from ./Include/pytime.h:6:0,
    from ./Include/Python.h:68,
    from Python/hamt.c:1:
    @@ -27,3 +27,25 @@ Python/hamt.c: In function â_PyHamt_Withoutâ:
    Python/hamt.c:2351:17: note: ânew_rootâ was declared here
    PyHamtNode *new_root;
    ^~~~~~~~
    ```
    and
    ```bash
    low = *((UINT32*)(laneAsBytes+0));
    ^~~
    In file included from /home/pi/Python-3.7.0/Modules/_sha3/sha3module.c:113:0:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_AddBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:152:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    low = *((UINT32*)(laneAsBytes+0));
    ^~~
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_ExtractBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:296:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *((UINT32*)(laneAsBytes+0)) = low;
    ^
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In function â_PySHA3_KeccakP1600_ExtractAndAddBytesInLaneâ:
    /home/pi/Python-3.7.0/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:369:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
    *((UINT32*)(laneAsBytes+0)) = low;
    ^
    gcc -pthr
    ```
  23. @SeppPenner SeppPenner renamed this gist Jul 5, 2018. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  24. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 29 additions and 0 deletions.
    29 changes: 29 additions & 0 deletions warnings.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    The warnings I get:


    In file included from ./Include/pytime.h:6:0,
    from ./Include/Python.h:68,
    from Python/hamt.c:1:
    Python/hamt.c: In function âhamt_py_deleteâ:
    ./Include/object.h:800:12: warning: ânew_rootâ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
    ^
    Python/hamt.c:2351:17: note: ânew_rootâ was declared here
    PyHamtNode *new_root;
    ^~~~~~~~
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/structmember.o Python/structmember.c
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE -o Python/symtable.o Python/symtable.c
    gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I. -I./Include -DPy_BUILD_CORE \
    -DABIFLAGS='"m"' \
    -DMULTIARCH=\"arm-linux-gnueabihf\" \
    -o Python/sysmodule.o ./Python/sysmodule.c
    In file included from ./Include/pytime.h:6:0,
    from ./Include/Python.h:68,
    from Python/hamt.c:1:
    Python/hamt.c: In function â_PyHamt_Withoutâ:
    ./Include/object.h:800:12: warning: ânew_rootâ may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (_Py_DEC_REFTOTAL _Py_REF_DEBUG_COMMA \
    ^
    Python/hamt.c:2351:17: note: ânew_rootâ was declared here
    PyHamtNode *new_root;
    ^~~~~~~~
  25. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 24 additions and 0 deletions.
    24 changes: 24 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    ./configure
    make -j 4
    sudo make altinstall

    echo "Do you wish to delete the source code and uninstall all previously installed packages? {Y/N} (Case sensitive!)"
    read ans
    if [ans = "Y"]
    then
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo apt-get --purge remove build-essential tk-dev
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    sudo apt-get autoremove
    sudo apt-get clean
    else
    echo "Done!"
    fi
  26. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Installing Python 3.7.0 on Raspbian
    =================================

    As of January 2017, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build
    As of July 2018, Raspbian does not yet include the latest Python release, Python 3.7.0 This means we will have to build
    it ourselves, and here is how to do it.

    1. Install the required build-tools (some might already be installed on your system).
  27. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ it ourselves, and here is how to do it.

    .. code-block:: bash
    sudo apt-get update
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    sudo apt-get update -y
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

  28. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ it ourselves, and here is how to do it.
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    ./configure
    make
    make -j 4
    sudo make altinstall
    4. Optionally: Delete the source code and uninstall the previously installed packages. When
  29. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -37,7 +37,7 @@ it ourselves, and here is how to do it.
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    sudo apt-get autoremove
    sudo apt-get autoremove -y
    sudo apt-get clean
    This guide is pretty much taken from the following tutorial:
  30. @SeppPenner SeppPenner revised this gist Jul 5, 2018. 1 changed file with 16 additions and 16 deletions.
    32 changes: 16 additions & 16 deletions Installing Python 3.7.0 on Raspbian.rst
    Original file line number Diff line number Diff line change
    @@ -8,8 +8,8 @@ it ourselves, and here is how to do it.

    .. code-block:: bash
    $ sudo apt-get update
    $ sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    sudo apt-get update
    sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    If one of the packages cannot be found, try a newer version number (e.g. ``libdb5.4-dev`` instead of ``libdb5.3-dev``).

    @@ -18,27 +18,27 @@ it ourselves, and here is how to do it.

    .. code-block:: bash
    $ wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    $ tar xf Python-3.7.0.tar.xz
    $ cd Python-3.7.0
    $ ./configure
    $ make
    $ sudo make altinstall
    wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
    tar xf Python-3.7.0.tar.xz
    cd Python-3.7.0
    ./configure
    make
    sudo make altinstall
    4. Optionally: Delete the source code and uninstall the previously installed packages. When
    uninstalling the packages, make sure you only remove those that were not previously installed
    on your system. Also, remember to adjust version numbers if necesarry.

    .. code-block:: bash
    $ sudo rm -r Python-3.7.0
    $ rm Python-3.7.0.tar.xz
    $ sudo apt-get --purge remove build-essential tk-dev
    $ sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev
    $ sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev
    $ sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
    $ sudo apt-get autoremove
    $ sudo apt-get clean
    sudo rm -r Python-3.7.0
    rm Python-3.7.0.tar.xz
    sudo apt-get --purge remove build-essential tk-dev -y
    sudo apt-get --purge remove libncurses5-dev libncursesw5-dev libreadline6-dev -y
    sudo apt-get --purge remove libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev -y
    sudo apt-get --purge remove libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev -y
    sudo apt-get autoremove
    sudo apt-get clean
    This guide is pretty much taken from the following tutorial:
    https://liudr.wordpress.com/2016/02/04/install-python-on-raspberry-pi-or-debian/