简体   繁体   中英

Python Flask - oserror errno 22 invalid argument

I have developed a UI with Python flask. By default it is running on port 5000. The home page of UI shows "OSError: [Errno 22] Invalid argument" . But when I run on the other port it is working fine, the home page of UI looks great.

What might be issue on default port 5000? I have searched around internet, most of the solution suggested to change the file path with \\\\ (double slash) in open() function. But I am not using anything of such kind. Can you please shed some light?

The port 5000 is being used by another process. To check what process holds the port 5000, do:

sudo netstat -anp | grep ':5000 '

and kill the process.

it seams that your port 5000 have a another process. so you can changing your port in a script for ruining the application. in last line of your code add "port" Variable like this:

if __name__ == '__main__':
     app.run(debug=True, host="0.0.0.0", port=8000)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM