Skip to content

Connection Refused Information

Pradyun edited this page Feb 22, 2016 · 3 revisions

If you are getting a Connection Refused error in anaconda follow the steps below to determine what could be wrong and then follow the guides to report it as an issue after check everything in this wiki page.

Check your python_interpreter

If your python_interpreter is not set or set wrong, Anaconda will fail to start it's server part and will not work at all, the python_interpreter is the most important setting to make the plugin work.

To check if your configured python interpreter is working, show the Sublime Text 3 console and write the following:

from Anaconda.anaconda_lib import helpers; import subprocess

If you get an ImportError change Anaconda to anaconda

interpreter = helpers.get_settings(view, 'python_interpreter')
subprocess.check_call([interpreter, '-c', 'pass'])

The output of the lines above should be 0 if you get an exception, your configured interpreter is not valid, make sure that it is in the path, you can check your environment variables in ST3 just writing import os; print(os.environ); in the ST3 command line.

If your interpreter is ok, next step is check that your ST3 is able to connect to localhost, follow the instructions below

Check Connectivity

To check the connectivity follow these three simple steps:

  1. Install netcat in your system (if you use Windows you can find Windows binary here)

  2. Open a terminal and write nc -l -p 1234 that will make netcat to listen up to anything that is sent to the port 1234 in your local machine

  3. Open the Sublime Text 3 console and write:

import socket; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM); s.connect(('localhost', 1234)); s.send(bytes('Hello World!\n', 'utf8')); s.close()


If your ST3 can connect to your local machine you will get a `Hello World!` in your terminal and the netcat that we setup in that step should be now terminated.

If everything looks fine, then look for Anaconda's JsonServer logs and post it in pastebin and create a new ticket specifying what did  you find following this procedure.

Log can be found in depending of your OS:

| Plaform   | Path |
| --------- | ------------- |
| GNU/Linux | ~/.cache/jedi | 
| OS X      | ~/Library/Cache/Jedi |
| Windows   | %APPDATA%\Jedi\Jedi |