【发布时间】:2022-01-09 20:52:40
【问题描述】:
I tried a lot to fix Traceback Error
相同的代码在 Pycharm 中工作,但是当我把它放在 replit.com 中时,显示这个错误
Python 3.8.2 (default, Feb 26 2020, 02:56:10)
Traceback (most recent call last):
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/xauth.py", line 43, in __init__
raw = open(filename, 'rb').read()
FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/.Xauthority'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 9, in <module>
import pyautogui
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pyautogui/__init__.py", line 249, in <module>
import mouseinfo
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/mouseinfo/__init__.py", line 223, in <module>
_display = Display(os.environ['DISPLAY'])
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/display.py", line 80, in __init__
self.display = _BaseDisplay(display)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/display.py", line 62, in __init__
display.Display.__init__(*(self, ) + args, **keys)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/protocol/display.py", line 60, in __init__
auth_name, auth_data = connect.get_auth(self.socket,
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/support/connect.py", line 91, in get_auth
return mod.get_auth(sock, dname, host, dno)
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/support/unix_connect.py", line 103, in new_get_auth
au = xauth.Xauthority()
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/Xlib/xauth.py", line 45, in __init__
raise error.XauthError('~/.Xauthority: %s' % err)
Xlib.error.XauthError: ~/.Xauthority: [Errno 2] No such file or directory: '/home/runner/.Xauthority'
请帮帮我
【问题讨论】: