Installing Python 2.7.9 (or Higher) or 3.4.3 (or Higher)

The Snowflake Connector for Python requires either Python version 2.7.9 (or higher) or version 3.4.3 (or higher) to ensure that critical security fixes have been applied. In particular, PEP-476 is required to ensure the Snowflake Connector for Python can verify certificates from the server.

This topic provides helpful information for installing either of the required Python versions. It does not provide full install instructions. For install instructions, see the Python documentation.

In this Topic:

Installing Python on Linux

If your Linux distribution has the package that includes Python 2.7.9 (or higher) or Python 3.4.3 (or higher), install either version using an appropriate package manager (i.e. yum/rpm or apt-get).

If your distribution does not have the package, download the tarball and build it as described in the following sections.

Building and Installing Python 2.7.10 for CentOS

  1. Download and build Python:

    sudo yum groupinstall development
    sudo yum install -y zlib-devel openssl-devel sliteq-devel bzip2-devel
    cd ~
    curl -O https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
    tar xvfz Python-2.7.10.tgz
    cd Python-2.7.10
    export PYTHON_TOP_DIR=~/python2.7.10
    ./configure --enable-shared --prefix=$PYTHON_TOP_DIR --enable-unicode=ucs4
    make
    make install
    
  2. Set the environment variables for your new Python installation:

    export PYTHON_TOP_DIR=~/python2.7.10
    export PATH=$PYTHON_TOP_DIR/bin:$PATH
    python --version
    

    Make sure the version is 2.7.9 (or higher).

    Optionally include these environment variables in .bashrc or whatever in the initialization of shell so that you can use the new Python right after login.

  3. Install the latest version of pip, a package management system used to install software packages. Then use it to install setuptools:

    curl -O https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
    pip install setuptools
    pip --version
    

    Make sure pip is located in /tmp/python2.7.10/bin.

Note

If you install Python 2.7.9 in the system directory, set the environment variables accordingly.

Building and Installing Python 3.4.3 for CentOS

  1. Download and build Python:

    sudo yum groupinstall development
    sudo yum install -y zlib-devel openssl-devel sliteq-devel bzip2-devel
    cd /tmp
    curl -O https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tgz
    tar xvfz Python-3.4.3.tgz
    cd Python-3.4.3
    export PYTHON_TOP_DIR=~/python3.4.3
    ./configure --enable-shared --prefix=$PYTHON_TOP_DIR --enable-unicode=ucs4
    make
    make install
    
  2. Set the environment variables for your new Python installation:

    export PYTHON_TOP_DIR=~/python3.4.3
    export PATH=$PYTHON_TOP_DIR/bin:$PATH
    python3 --version
    

    Make sure the version is 3.4.3 (or higher).

    Optionally include these environment variables in .bashrc or whatever in the initialization of shell so that you can use the new Python right after login.

  3. Install the latest version of pip3, a package management system used to install software packages. Then use it to install setuptools:

    curl -O https://bootstrap.pypa.io/get-pip.py
    python3 get-pip.py
    pip3 install setuptools
    pip3 --version
    

    Make sure pip3 is located in ~/python3.4.3/bin.

Note

If you install Python 3.4.3 in the system directory, set the environment variables accordingly.

Installing Python on Windows and Mac OS X

The package for Python 2.7.9/3.4.3 (or higher) for Windows and Mac OS X should be available from the Python Software Foundation website.

Download and install it in the default location. pip and setuptools are bundled by default.