我正在尝试按照以下指示在我的64位Ubuntu 16.04上安装Pygobject:https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html
建议使用jhbuild
构建pygobject。因此,我安装了jhbuild
(在这里按照https://developer.gnome.org/jhbuild/unstable/getting-started.html.en的指示进行操作之前从未见过的东西),效果很好。
最初,我必须运行jhbuild sysdeps --install
来安装丢失的依赖项,这花费了很长时间。完成后,它说Nothing to install
,我认为这意味着它找到了所需的一切。
然后
jhbuild bootstrap
命令说*** success *** [1/1]
。好吧。
jhbuild sanitycheck
没有输出(据说)表示一切正常。
然后,我运行命令jhbuild build pygobject
并收到错误消息:
Checking if "C_IN in public headers (no arpa/nameser_compat.h needed)"
compiles: NO
Checking if "arpa/nameser_compat.h needed for C_IN" compiles: NO
gio/meson.build:35:6: ERROR: Problem encountered: Could not find
required includes for ARPA C_IN
A full log can be found at
/home/anshulvj/.cache/jhbuild/build/glib/meson-logs/meson-log.txt
*** Error during phase configure of glib: ########## Error running
meson --prefix /home/anshulvj/jhbuild/install --libdir lib -
Dlibmount=false --buildtype=debugoptimized -Dgtk_doc=false
/home/anshulvj/jhbuild/checkout/glib *** [6/10]
[1] Rerun phase configure
[2] Ignore error and continue to build
[3] Give up on module
[4] Start shell
[5] Reload configuration
[6] Go to phase "wipe directory and start over"
choice:
不管选择什么,如果我选择[2],它要么结束构建,要么给出如下错误:
*** Building glib *** [6/10]
ninja
ninja: error: loading 'build.ninja': No such file or directory
*** Error during phase build of glib: ########## Error running ninja
*** [6/10]
.
.
.
然后
configure: error: Package requirements (glib-2.0 >= 2.57.1) were not met:
Requested 'glib-2.0 >= 2.57.1' but version of GLib is 2.48.2
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables GLIB_CFLAGS
and GLIB_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
*** Error during phase configure of gobject-introspection: ########## Error running /home/anshulvj/jhbuild/checkout/gobject-introspection/autogen.sh --prefix /home/anshulvj/jhbuild/install --disable-Werror --with-python=python3 --disable-static --disable-gtk-doc *** [9/10]
这很奇怪,因为我找不到与在线安装glib2.57
或更高版本有关的任何内容。 (https://github.com/GNOME/glib)
https://python-gtk-3-tutorial.readthedocs.io/en/latest/install.html上的文档没有处理这些错误,我完全迷路了。我在Google上搜索了很多,但没有找到面临同样问题的任何人。如果这不起作用,我将放弃使用Python3 + GTK3 +。
感谢任何帮助/指针。
编辑:今天,我尝试根据此处https://pygobject.readthedocs.io/en/latest/getting_started.html的说明使用pip进行安装。我使用pip或pip3都没关系,但出现以下错误。
(venv) anshulvj@anshulvj-HP-ZBook-15-G3:~/IRS2-415-Python$ pip3 install pygobject
Collecting pygobject
Using cached https://files.pythonhosted.org/packages/e0/e8/1e4f21800015a9ca153969e85fc29f7962f8f82fc5dbc1ecbdeb9dc54c75/PyGObject-3.28.3.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in ./venv/lib/python3.6/site-packages (from pygobject) (1.17.1)
Installing collected packages: pygobject
Running setup.py install for pygobject ... error
Complete output from command /home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/generictreemodel.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/pygtkcompat.py -> build/lib.linux-x86_64-3.6/pygtkcompat
copying pygtkcompat/__init__.py -> build/lib.linux-x86_64-3.6/pygtkcompat
creating build/lib.linux-x86_64-3.6/gi
copying gi/_error.py -> build/lib.linux-x86_64-3.6/gi
copying gi/module.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_option.py -> build/lib.linux-x86_64-3.6/gi
copying gi/types.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/pygtkcompat.py -> build/lib.linux-x86_64-3.6/gi
copying gi/importer.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_constants.py -> build/lib.linux-x86_64-3.6/gi
copying gi/__init__.py -> build/lib.linux-x86_64-3.6/gi
copying gi/docstring.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.6/gi
copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.6/gi
creating build/lib.linux-x86_64-3.6/gi/repository
copying gi/repository/__init__.py -> build/lib.linux-x86_64-3.6/gi/repository
creating build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GLib.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GObject.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/GIMarshallingTests.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gio.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Pango.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gtk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/__init__.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/Gdk.py -> build/lib.linux-x86_64-3.6/gi/overrides
copying gi/overrides/keysyms.py -> build/lib.linux-x86_64-3.6/gi/overrides
running build_ext
pycairo: new API
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 840, in <module>
main()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 835, in main
zip_safe=False,
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/setuptools-28.8.0-py3.6.egg/setuptools/command/install.py", line 61, in run
File "/usr/lib/python3.6/distutils/command/install.py", line 589, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
self.run_command(cmd_name)
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 684, in run
self._setup_extensions()
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 680, in _setup_extensions
add_pycairo(gi_cairo_ext)
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 665, in add_pycairo
ext.include_dirs += [get_pycairo_include_dir()]
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 582, in get_pycairo_include_dir
include_dir = find_path(find_new_api())
File "/tmp/pip-install-kikh0jeu/pygobject/setup.py", line 532, in find_new_api
import cairo
File "/home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/__init__.py", line 1, in <module>
from ._cairo import * # noqa: F401,F403
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
----------------------------------------
Command "/home/anshulvj/IRS2-415-Python/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-kikh0jeu/pygobject/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-6r4kbumk/install-record.txt --single-version-externally-managed --compile --install-headers /home/anshulvj/IRS2-415-Python/venv/include/site/python3.6/pygobject" failed with error code 1 in /tmp/pip-install-kikh0jeu/pygobject/
找不到太多关于
ImportError: /home/anshulvj/IRS2-415-Python/venv/lib/python3.6/site-packages/cairo/_cairo.cpython-36m-x86_64-linux-gnu.so: undefined symbol: cairo_tee_surface_index
在线。任何帮助表示赞赏。