0

I'm having trouble running my Flask app on GitBash for Windows. When I activate my virtualenv and I do:

python main.py

My Bash becomes frozen for a few seconds, then it displays the error:

  File "C:\Users\shrey\AppData\Local\Programs\Python\Python37- 
  32\lib\http\server.py", line 137, in server_bind
  socketserver.TCPServer.server_bind(self)
  File "C:\Users\shrey\AppData\Local\Programs\Python\Python37- 
  32\lib\socketserver.py", line 466, in server_bind
  self.socket.bind(self.server_address)
  OSError: [WinError 10013] An attempt was made to access a socket in a way 
  forbidden by its access permissions

Can anyone help? It's getting really annoying and I'm not able to QA my code at all. Any help is appreciated- thanks!

shreyshrey
  • 515
  • 6
  • 20

1 Answers1

1

Just realized my error. I had run netstat -ban and realized that the port I was trying to run it on (port 5000) was banned and therefore was causing all of my problems. In my main.py app I changed my code to:

if __name__ == '__main__':
  app.run(port=1000)

And it worked. Finally!

shreyshrey
  • 515
  • 6
  • 20