Search code examples
pythonlinuxflask-restful

linux python3 errors ; "OSError [Errno 98]" or "The kernel process exited. (0)"


I use python IDE named pyzo and using the miniconda interpreter.

I imported flask_restful module.

Imported modules are as below :

    from datetime import datetime
    import hashlib as hasher
    from flask import Flask
    from flask_restful import reqparse, abort, Api, Resource

When I import and use flask_restful module, I got this error :

    Traceback (most recent call last):
      File "/home/taylor/Documents/Python_codes/ofyp_blockchain.py", line 130, in <module>
        app.run(debug=True)
      File "/home/taylor/miniconda3/lib/python3.5/site-packages/flask/app.py", line 841, in run
        run_simple(host, port, self, **options)
      File "/home/taylor/miniconda3/lib/python3.5/site-packages/werkzeug/serving.py", line 795, in run_simple
        s.bind(get_sockaddr(hostname, port, address_family))
    OSError: [Errno 98] Address already in use

so, I typed "netstat -tulpn" and killed python3 and python program processes. then I got the error below :

    GLib-GIO-Message: Using the 'memory' GSettings backend.
    Your settings will not be saved or shared with other applications.

    The kernel process exited. (0)

so.. I tried "$ export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/" command, but I got OSError(Errno 98) again.

What can I do?


Solution

  • sudo lsof -t -i tcp:8000 | xargs kill -9

    port number = 8000

    you need to kill the port which already running