Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sublime Text 3: Anaconda package error connection to localhost timed out

I am getting a bizarre error message when starting up sublime text 3.

upon startup, I get the error below.

Window Error

Here's some background on my system:

Windows 10

Sublime Text 3 (Anaconda Package installed through Sublime Text package installer)

From CMD:

C:\Users\joshu>where python
C:\cygwin64\bin\python
C:\Users\joshu\Anaconda3\python.exe

C:\Users\joshu>which python
/usr/bin/python

C:\Users\joshu>python --version
Python 3.5.2 :: Anaconda 4.2.0 (64-bit)

From sublime text 3 console:

sys.version
'3.3.6 (default, Sep 22 2016, 23:32:57) [MSC v.1600 64 bit (AMD64)]'

sys.path

['C:\\Users\\joshu\\AppData\\Roaming\\Sublime Text 3\\Installed Packages\\AutoPEP8.sublime-package\\sublimeautopep8lib\\packages_py3', 'C:\\Program Files\\Sublime Text 3', 'C:\\Program Files\\Sublime Text 3/python3.3.zip', 'C:\\Users\\joshu\\AppData\\Roaming\\Sublime Text 3\\Packages', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\pygments\\all', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\coverage\\ST3_WI~2', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\MARKUP~1\\all', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\PYTHON~1\\st3', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\PYTHON~2\\all', 'C:\\Users\\joshu\\AppData\\Roaming\\SUBLIM~1\\Packages\\mdpopups\\st3', 'C:\\Users\\joshu\\AppData\\Roaming\\Sublime Text 3\\Packages\\coverage\\st3_windows_x64']

The first problem is that I don't know how to "check that there is Python process executing the anaconda jsonserver.py script ".

But ultimately I am at a lost on how to fix this issue.

My 'test' to see if anaconda was working was to try importing Numpy (which didn't work.. no module detected).

I did paste the following code into the sublime text 3 console.. didn't look like anything happened:

import socket; socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(("localhost", 59552))
like image 661
Joshua Zastrow Avatar asked Jan 25 '17 11:01

Joshua Zastrow


3 Answers

In the menu:

Preferences > Package Settings > Anaconda > Settings - User

If your user settings file is empty, write:

{
    "swallow_startup_errors": true
}

and save.

If you already have other user settings in this file, just add this one to them

like image 175
Galapagos Avatar answered Nov 09 '22 09:11

Galapagos


Update: I Found the jsonserver.py file by searching for it in the AppData directory under sublime text..

Sublime Text console:

import sys
print(sys.path)

copy the path to Sublime Text 3 Anaconda folder in the file exploere, then I searched for jsonserver.py

When I tried to open the file, it would close itself. Not sure if that was a good or bad thing.

Ultimately I removed then reinstalled the Anaconda package. That seemed to fix the issue (although I am unsure of the root cause :/ )

like image 2
Joshua Zastrow Avatar answered Nov 09 '22 10:11

Joshua Zastrow


I had this issue on my Mac. On a terminal I checked if the jsonserver.py was running.

$ ps aux | grep jsonserver
user1         17170   0.0  0.0  4286488    856 s001  S+   10:51am   0:00.00 grep jsonserver.py
user1         14803   0.0  0.4  4358656  74252   ??  S    10:31am   0:06.30 python -B /path/to/jsonserver.py -p cxda 51380 -e /path/to/folders/,/path/to/other/folder/ 7973
user1         14787   0.0  0.2  4312684  26444   ??  S    10:31am   0:00.53 python -B /path/to/jsonserver.py -p cxda 51357 -e /path/to/folders/,/path/to/other/folder/ 7973

The results showed I had two jsonservers running using the same port. So I disabled anaconda in Sublime using command+shift+p and searching for Package Control: Disable Package. Simply type disa and it should come up straight away.

After disabling the package, I killed the two processes.

$ kill 14803
$ kill 14787
$ ps aux | grep jsonserver
user1         17220   0.0  0.0  4277272    840 s001  S+   10:52am   0:00.00 grep jsonserver.py

Then I enabled the package via package control in sublime using command+shift+p. Enabling the package will start a new jsonserver.py. This solved the issue for me.

like image 2
GeneticsGuy Avatar answered Nov 09 '22 10:11

GeneticsGuy