linux python3错误; " OSError [Errno 98]"或者"内核进程退出。 (0)"

时间:2018-01-02 13:09:54

标签: python linux flask-restful

我使用名为pyzo的python IDE并使用miniconda解释器。

我导入了flask_restful模块。

导入的模块如下:

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

当我导入并使用flask_restful模块时,我收到此错误:

    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

所以,我输入了&#34; netstat -tulpn&#34;并杀死了python3和python程序进程。 然后我得到了以下错误:

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

    The kernel process exited. (0)

所以..我试过&#34; $ export GIO_EXTRA_MODULES = / usr / lib / x86_64-linux-gnu / gio / modules /&#34;命令,但我再次得到了OSError(Errno 98)。

我该怎么办?

1 个答案:

答案 0 :(得分:0)

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

端口号= 8000

你需要杀死已经运行的端口