簡體   English   中英

PermissionError:[Errno 13] python 項目中的權限被拒絕

[英]PermissionError: [Errno 13] Permission denied in python project

我正在開發一個需要安裝 airnotifier 的應用程序,我已按照以下鏈接中的安裝說明進行操作:

https://github.com/dcai/airnotifier/wiki/Installation-3.x

在運行 app.py 的最后一個命令中,出現以下錯誤

airnotifier@airnotifier:~/airnotifier$ pipenv run python app.py
app.py:73: DeprecationWarning: The 'warn' function is deprecated, use 'warning' instead
  logging.warn("Sentry dsn is not set")
[W 220718 20:08:43 app:73] Sentry dsn is not set
[I 220718 20:08:43 routes:73] init route: controllers.auth
[I 220718 20:08:43 routes:73] init route: controllers.base
[I 220718 20:08:43 routes:73] init route: controllers.broadcast
[I 220718 20:08:43 routes:73] init route: controllers.keys
[I 220718 20:08:43 routes:73] init route: controllers.newapp
[I 220718 20:08:43 routes:73] init route: controllers.settings
[I 220718 20:08:43 routes:73] init route: controllers.tokens
[I 220718 20:08:43 routes:73] init route: api.accesskeys
[I 220718 20:08:43 routes:73] init route: api.broadcast
[I 220718 20:08:43 routes:73] init route: api.push
[I 220718 20:08:43 routes:73] init route: api.tokens
Traceback (most recent call last):
  File "app.py", line 95, in <module>
    WebApplication(container).main()
  File "/home/airnotifier/airnotifier/web.py", line 146, in main
    http_server.listen(options.port)
  File "/home/airnotifier/.local/share/virtualenvs/airnotifier-dIcrTSca/lib/python3.8/site-packages/tornado/tcpserver.py", line 151, in listen
    sockets = bind_sockets(port, address=address)
  File "/home/airnotifier/.local/share/virtualenvs/airnotifier-dIcrTSca/lib/python3.8/site-packages/tornado/netutil.py", line 174, in bind_sockets
    sock.bind(sockaddr)
PermissionError: [Errno 13] Permission denied
airnotifier@airnotifier:~/airnotifier$

我檢查了文件的權限並搜索了很多但找不到解決此問題的方法

您需要使用sudo運行,如您鏈接的安裝說明中所述。 如您所見,錯誤來自嘗試將套接字綁定到端口。 很可能它正在嘗試使用特權端口(<1024),這只能通過提升的權限(即sudo )來完成。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM