Server error 9904: cannot find free port


Hi all,

I met a problem when trying to grab data from muse-io with the example Python pyliblo code. I pip installed pyliblo and then ran the file in terminal. What I got is this error 9904: cannot find free port. I searched for previous post and saw one actually mentioned this error:

However, this is not my case. I don’t have another program also listening on the same port. Thus, can anyone tell me what causes my problem?



Hi hymis,

There may be a process running and listening on that port that you don’t know about. Have you tried using a different port number? That’s the easiest way to get around this issue.

If your system has lsof, you can also try something like:

lsof -i :5000

…which ought to show you if a process is using port 5000 already. I believe it’s also possible to check this with netstat.


Hi Tom,

Thank you for your advice. I change to a different port and the code works now!