python - linux python3错误; "OSError [Errno 98]"或 "The kernel process exited. (0)"

标签 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

因此,我输入“netstat -tulpn”并终止了 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)

所以..我尝试了“$ export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/”命令,但我又遇到了 OSError(Errno 98)。

我能做什么?

最佳答案

须藤 lsof -t -i tcp:8000 | xargs kill -9

端口号 = 8000

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

关于python - linux python3错误; "OSError [Errno 98]"或 "The kernel process exited. (0)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48061631/

相关文章:

python - Django 电子商务中的 URL 安全

python - "the following packages will be superseded by a higher priority channel"是什么意思?

linux - Jenkins 管道中的多行 bash 命令

python - Flask-RESTful-返回自定义响应格式

python-3.x - Jsonify 异常错误

python - 使用 flask 对请求中的嵌套对象进行单元测试

python - 如何将 Django 连接到 MongoDB 数据库?

python - 如何使用 selenium webdriver python 中的跨度中的定位器打印文本?

python - Django - 登录 View : 'AnonymousUser' object has no attribute '_meta'

linux - 是否有随机数的系统调用?