redis.exceptions.ConnectionError: Error 97 connecting to localhost:6379. Address family not supported by protocol
<p>when ever i try to run my program following error will will raise.</p>

<p>redis.exceptions.ConnectionError: Error 97 connecting to localhost:6379. Address family not supported by protocol.</p>

<p>Previously the program runs normally now this error will be raised.</p>

<pre><code>Traceback (most recent call last):
  File "securit.py", line 26, in &lt;module&gt;
    bank = red.get('bank')
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 880, in get
    return self.execute_command('GET', name)
  File "/usr/local/lib/python2.7/dist-packages/redis/client.py", line 578, in execute_command
    connection.send_command(*args)
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 563, in send_command
    self.send_packed_command(self.pack_command(*args))
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 538, in send_packed_command
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 442, in connect
    raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 97 connecting to localhost:6379. Address family not supported by protocol.
</code></pre>

<p>Finally i got answer for above qustion.Step by step the following done</p>

<pre><code> Setup

    Before you install redis, there are a couple of prerequisites that need to be downloaded to make the installation as easy as possible.

    Start off by updating all of the apt-get packages:

    **sudo apt-get update**

    Once the process finishes, download a compiler with build essential which will help us install Redis from source:

     **sudo apt-get install build-essential**

    Finally, we need to download tcl:

     **sudo apt-get install tcl8.5**

    Installing Redis

    With all of the prerequisites and dependencies downloaded to the server, we can go ahead and begin to install redis from source:

    Download the latest stable release tarball from Redis.io.

    **wget http://download.redis.io/releases/redis-stable.tar.gz**

    Untar it and switch into that directory:

    **tar xzf redis-stable.tar.gz**

    **cd redis-stable**

    Proceed to with the make command:

    **make**

    Run the recommended make test:

    **make test**

    Finish up by running make install, which installs the program system-wide.

    **sudo make install**

    Once the program has been installed, Redis comes with a built in script that sets up Redis to run as a background daemon.

    To access the script move into the utils directory:

    **cd utils**

    From there, run the Ubuntu/Debian install script:

    **sudo ./install_server.sh**

    As the script runs, you can choose the default options by pressing enter. Once the script completes, the redis-server will be running in the background.
</code></pre>

python django redis socket.io