Ubuntu-Anaconda 2020.02-命名空间Gtk不可用 [英] Ubuntu - Anaconda 2020.02 - Namespace Gtk not available
问题描述
这是在Ubuntu 16.04 LTS上.
This is on Ubuntu 16.04 LTS.
我遇到了与此问题相同的问题:
I've run into the same issue as this question:
我已经完成了以下操作来设置gtk3
I've done the following to set things up for gtk3
conda install -c conda-forge pygobject
sudo apt-get install libgtk-3-dev
sudo apt install python3-gi gobject-introspection gir1.2-gtk-3.0
但是,简单的测试程序位于:
However, the simple test program at:
https://python-gtk-3-tutorial .readthedocs.io/en/latest/introduction.html
失败,出现相同错误:
Python 3.7.7 (default, Mar 26 2020, 15:48:22)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gi
>>> gi.require_version("Gtk", "3.0")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/me/anaconda3/lib/python3.7/site-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace Gtk not available
还有其他可以尝试的解决方案吗?
Any other solutions that might be tried?
这是全新安装的Anaconda(Anaconda3-2020.02-Linux-x86_64.sh);安装后进行了conda更新-全部.但是我想知道可能是什么问题.
This was on a fresh install of Anaconda (Anaconda3-2020.02-Linux-x86_64.sh); did a conda update --all after installation. But am wondering what might be wrong.
推荐答案
conda-forge上有一个gtk3
软件包:
There is a gtk3
package available on conda-forge:
conda install -c conda-forge gtk3
这篇关于Ubuntu-Anaconda 2020.02-命名空间Gtk不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!