gpt4 book ai didi

python-3.x - Travis-ci 和 Gobject 内省(introspection)

转载 作者:行者123 更新时间:2023-12-02 03:38:00 25 4
gpt4 key购买 nike

我正在尝试为 Getting Things GNOME! 设置 Travis 。我的.travis.yml :

language: python

python:
- '3.3'

before_install:
- sudo apt-get update
- sudo apt-get install -qq python3-gi gir1.2-gtk-3.0

virtualenv:
system_site_packages: true

install:
- pip install -e git+git://github.com/getting-things-gnome/liblarch.git#egg=liblarch
- pip install -r requirements.txt

script:
- ./run-tests

但是,build失败:

======================================================================
ERROR: Failure: ImportError (No module named 'gi._gi')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/nose/failure.py", line 38, in runTest
raise self.exc_val.with_traceback(self.tb)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/nose/loader.py", line 413, in loadTestsFromName
addr.filename, addr.module)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/imp.py", line 180, in load_module
return load_source(name, filename, file)
File "/home/travis/virtualenv/python3.3_with_system_site_packages/lib/python3.3/imp.py", line 119, in load_source
_LoadSourceCompatibility(name, pathname, file).load_module(name)
File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
File "<frozen importlib._bootstrap>", line 1022, in load_module
File "<frozen importlib._bootstrap>", line 1003, in load_module
File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
File "<frozen importlib._bootstrap>", line 868, in _load_module
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "/home/travis/build/getting-things-gnome/gtg/tests/tools/test_networkmanager.py", line 22, in <module>
from GTG.tools.networkmanager import is_connection_up
File "/home/travis/build/getting-things-gnome/gtg/GTG/tools/networkmanager.py", line 23, in <module>
from gi.repository import NetworkManager, NMClient
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 23, in <module>
from ._gi import _API, Repository
ImportError: No module named 'gi._gi'

模块 gi._gi 应安装为 packge python3-gi

为什么 Travis 无法导入 gi 模块?

最佳答案

使用 Python 版本 3.2 而不是 3.3 解决了该问题

相关讨论可以在这里找到:https://github.com/getting-things-gnome/gtg/issues/10

关于python-3.x - Travis-ci 和 Gobject 内省(introspection),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22748528/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com