微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Google Colab与tkinter一起挂起python模块

如何解决Google Colab与tkinter一起挂起python模块

我已经尝试通过google colab笔记本测试Deaf Communicator GitHub project,如您在此处看到的: https://colab.research.google.com/drive/1LdZEEuwKkIHfydVI3lhMfk1QjWbHDUb7?usp=sharing

image

此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

image

因此,如果可能,请查看它以修复该错误。 还问这里: https://github.com/shubham-thakare/deaf-communicator/issues/1

谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?