首页 文章

PyObject Pycharm在Ubuntu 14.04 LTS中设置失败

提问于
浏览
1

我无法在我的pycharm项目中设置pyobject . 当我在我的项目错误消息中尝试添加PyGObject包时,我得到了以下内容 .

Pycharm Console Error Message

Collecting PyGObject
  Using cached https://files.pythonhosted.org/packages/8c/1f/76533985b054473ef6ab1ba4d9c00d62da502f8b43d3171ae588ec81ae93/PyGObject-3.30.4.tar.gz
Requirement already satisfied: pycairo>=1.11.1 in /home/ritwik/PycharmProjects/WeatherApp/venv/lib/python3.6/site-packages (from PyGObject) (1.18.0)
Installing collected packages: PyGObject
  Running setup.py install for PyGObject: started
    Running setup.py install for PyGObject: finished with status 'error'
    Complete output from command /home/ritwik/PycharmProjects/WeatherApp/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/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-tlwks9ju/install-record.txt --single-version-externally-managed --compile --install-headers /home/ritwik/PycharmProjects/WeatherApp/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/pygtkcompat.py -> build/lib.linux-x86_64-3.6/pygtkcompat
    copying pygtkcompat/generictreemodel.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/pygtkcompat.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_signalhelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/__init__.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_constants.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/types.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/docstring.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/module.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_gtktemplate.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_option.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_propertyhelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/importer.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_ossighelper.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_compat.py -> build/lib.linux-x86_64-3.6/gi
    copying gi/_error.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/GIMarshallingTests.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/Pango.py -> 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/Gio.py -> build/lib.linux-x86_64-3.6/gi/overrides
    copying gi/overrides/keysyms.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/GdkPixbuf.py -> build/lib.linux-x86_64-3.6/gi/overrides
    warning: build_py: byte-compiling is disabled, skipping.

    running build_ext
    Requested 'gobject-introspection-1.0 >= 1.46.0' but version of gobject-introspection is 1.40.0
    Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.

    ----------------------------------------

Command "/home/ritwik/PycharmProjects/WeatherApp/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pycharm-packaging/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-tlwks9ju/install-record.txt --single-version-externally-managed --compile --install-headers /home/ritwik/PycharmProjects/WeatherApp/venv/include/site/python3.6/PyGObject" failed with error code 1 in /tmp/pycharm-packaging/PyGObject/

我尝试了不同的解决方案,但没有一个适合我 . 我也尝试通过终端导航到目录并使用pip命令,但我失败了 . 请让我知道这是什么解决方案

Below is the list of libraries already installed in my project

Schemer 0.2.11  0.2.11
certifi 2018.11.29  2018.11.29
chardet 3.0.4   3.0.4
idna    2.8 2.8
inflection  0.3.1   0.3.1
pip 18.1    18.1
pycairo 1.18.0  1.18.0
pymongo 3.7.2   
requests    2.20.1  2.20.1
setuptools  40.6.2  40.6.2
urllib3 1.24.1  1.24.1

我也可以在我的系统中本地创建GTK项目,但不能在pycharm中创建 .

请帮忙谢谢

1 回答

  • 0

    再看一下你的错误信息,特别是这部分:

    Requested 'gobject-introspection-1.0 >= 1.46.0' but version of gobject-introspection is 1.40.0
    Command '('pkg-config', '--print-errors', '--exists', 'gobject-introspection-1.0 >= 1.46.0')' returned non-zero exit status 1.
    

    它说您正在尝试获得版本> = 1.46.0,但存在的版本是1.40.0 . 您不能使用高于存在的版本的版本 . 因此,您或您要导入的内容正在尝试导入不存在的版本 . 我会尝试更改版本,它应该工作!

相关问题