For me "root_path" solved the problem,
Lets say I have the following path:
"C:\script\mycode\src\swagger.json"
def resource_path(relative_path): base_path = getattr( sys, '_MEIPASS', os.path.dirname(os.path.abspath(__file__))) return os.path.join(base_path, relative_path) new_path = resource_path("swagger.json") new_path = new_path.replace("swagger.json", "") app = Flask(__name__, root_path=new_path, static_folder="") print("app.root_path ===================>>",app.root_path) #prints: "C:\script\mycode\src\" app.register_blueprint(get_swaggerui_blueprint( '/api/swagger', "\\swagger.json", #put starting slash even the app.root_path ends with #slash. and check in "app.root_path" if additional path #need to be added with "\\swagger.json" config=apiConfig), url_prefix=apiPrefixV1+'swagger', name='v1') Note: For me resource path is used for pyinstaller build. For local test also works fine!