Bokeh Server Embed in Flask Application "Port in Use" OSError

Update

I was able to get this error to go away by following the instructions for running Bokeh with Flask on gunicorn. This handles multi-threaded situations and creates multiple ports, which is how Flask defaults to now even without gunicorn. I am not using gunicorn.

However, my plots still are not showing up on the webpage even though this error is now gone. I am passing the port from my init.py to my routes.py through an os environment variable, which I’m not sure is the correct way to implement this. I’ll keep troubleshooting but I’d appreciate anyone’s thoughts on how to best handle this.