如何解决Google Colab与tkinter一起挂起python模块
我已经尝试通过google colab笔记本测试Deaf Communicator GitHub project,如您在此处看到的: https://colab.research.google.com/drive/1LdZEEuwKkIHfydVI3lhMfk1QjWbHDUb7?usp=sharing
此GitHub项目需要tkinter python混乱,并且基于 this post,我尝试使用以下代码修复tkinter模块的colab问题,但问题在于它挂在运行以下命令上:
!apt-get install -y xvfb # Install X Virtual Frame Buffer
import os
os.system('Xvfb :1 -screen 0 1600x1200x16 &') # create virtual display with size 1600x1200 and 16 bit color. Color can be changed to 24 or 8
os.environ['disPLAY']=':1.0' # tell X clients to use our virtual disPLAY :1.0
%cd /content/deaf-communicator
!python -m DEAF.py
结果如下:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
xvfb
0 upgraded,1 newly installed,0 to remove and 21 not upgraded.
Need to get 783 kB of archives.
After this operation,2,266 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 xvfb amd64 2:1.19.6-1ubuntu4.7 [783 kB]
Fetched 783 kB in 1s (1,117 kB/s)
Selecting prevIoUsly unselected package xvfb.
(Reading database ... 144655 files and directories currently installed.)
Preparing to unpack .../xvfb_2%3a1.19.6-1ubuntu4.7_amd64.deb ...
Unpacking xvfb (2:1.19.6-1ubuntu4.7) ...
Setting up xvfb (2:1.19.6-1ubuntu4.7) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
/content/deaf-communicator
因此,如果可能,请查看它以修复该错误。 还问这里: https://github.com/shubham-thakare/deaf-communicator/issues/1
谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。