Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ssis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 为什么在尝试在Colab中导入pyatogui时会出现此错误?_Python_Google Colaboratory_Libraries - Fatal编程技术网

Python 为什么在尝试在Colab中导入pyatogui时会出现此错误?

Python 为什么在尝试在Colab中导入pyatogui时会出现此错误?,python,google-colaboratory,libraries,Python,Google Colaboratory,Libraries,这就是我在第一个牢房里看到的 然后,当我尝试导入pyautogui时,它显示以下错误: !sudo apt install tesseract-ocr !pip install pytesseract !pip install pyinstaller !pip install pyautogui !pip install pillow !pip install python3_xlib python-xlib 我想这与colab无法连接到我的计算机有关,但我不知道。可能是因为X服务器

这就是我在第一个牢房里看到的

然后,当我尝试导入pyautogui时,它显示以下错误:

!sudo apt install tesseract-ocr

!pip install pytesseract

!pip install pyinstaller

!pip install pyautogui

!pip install pillow

!pip install python3_xlib python-xlib

我想这与colab无法连接到我的计算机有关,但我不知道。

可能是因为X服务器没有运行。不确定是否可以在其中安装xorg。pyautogui在服务器窗口中执行操作对您来说是否干净?如果你想拥有一个笔记本,并在本地窗口上进行操作,你必须在你的机器上使用本地的jupyter笔记本。那么我必须使用jupyter笔记本?在colab中使用pyautogui是不可能的吗?即使你可以控制那边的窗口,远程机器。你想用pyautogui实现什么?我想截取一个由python程序解决的数独游戏的屏幕截图
ConnectionRefusedError                    Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/Xlib/support/unix_connect.py in get_socket(dname, protocol, host, dno)
    118             try:
--> 119                 s = _get_unix_socket(address)
    120             except socket.error:

10 frames
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

ConnectionRefusedError                    Traceback (most recent call last)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

DisplayConnectionError                    Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/Xlib/support/unix_connect.py in get_socket(dname, protocol, host, dno)
    125                     raise
    126     except socket.error as val:
--> 127         raise error.DisplayConnectionError(dname, str(val))
    128 
    129     # Make sure that the connection isn't inherited in child processes.

DisplayConnectionError: Can't connect to display ":0": [Errno 111] Connection refused