Trouble getting started on Mac: port weirdness


Hi. I’m reading the book (How to Build a Brain) and trying to set up Nengo on my MacBook Pro running Sierra (10.12.3 ). I’ve downloaded Anaconda and Nengo, and when I execute “nengo” from the terminal it fires up Safari, and I see three panes, but then I get the dialog box saying “Nengo has stopped running”. Trying to reload the page generates a message from Safari saying it can’t load the page


because it can’t connect to the server “localhost”. I know Apache, the web server, is running because I can put “localhost” into the address and I get “It works!”. I edited the httpd.conf file for Apache to add “Listen 8080” (so, listen to port 8080), restarted Apache, and when I tried “nengo” again I got the same response, except that the address bar was now pointed at localhost:8081, so incremented by one. I then added “Listen 8081” to the config file to check, and of course it incremented to 8082.

So I’m not sure what to try next. Any ideas?


Hi, your Apache has nothing to do with Nengo which provides its own web server. (Except that Nengo switches to a different port when when 8080 is already taken by another server as you observed.) From the information you provided it is not completely clear to me what the problem is. It would be helpful if you could post the terminal output of nengo. It is possible that starting Nengo with nengo --auto-shutdown 0 will work as a workaround for now.

Also, I am not sure whether we currently support Safari. I would recommend using Chrome. Firefox should also work, but might be slower.


Thanks! The workaround did not work, but switching the default browser to Chrome did. Here’s the terminal output from the failed attempt, just in case it’s useful:

Jamess-MBP:~ james$ nengo
Starting nengo server at http://localhost:8080
ERROR:nengo_gui.guibackend:Error during websocket communication.
Traceback (most recent call last):
  File "/Users/james/anaconda/lib/python3.6/site-packages/nengo_gui/", line 223, in ws_default
    msg =
  File "/Users/james/anaconda/lib/python3.6/site-packages/nengo_gui/", line 363, in read_frame
  File "/Users/james/anaconda/lib/python3.6/site-packages/nengo_gui/", line 344, in _read
    self._buf = self._buf + bytearray(self.socket.recv(512))
ConnectionResetError: [Errno 54] Connection reset by peer
No connections remaining to the nengo_gui server.
Shutting down server...


I prepared a patch to fix the Safari issue.