How to install PyGObject through PyCharm

2019-05-31 03:07发布

I tried to install PyGobject through PyCharm but when I click on install package i will get this window: enter image description here

This is what the "Command output" is:

Collecting PyGObject
  Using cached pygobject-2.28.3.tar.bz2
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Gebruiker\AppData\Local\Temp\pycharm-packaging0.tmp\PyGObject\setup.py", line 272
        raise SystemExit, 'ERROR: Nothing to do, gio could not be found and is essential.'
                        ^
    SyntaxError: invalid syntax

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

Command "python setup.py egg_info" failed with error code 1 in C:\Users\Gebruiker\AppData\Local\Temp\pycharm-packaging0.tmp\PyGObject

(If the red colored text is not good to read, i got it typed out here: raise SystemExit, 'ERROR: Nothing to do, gio could not be found and is essential')

I hope someone knows the answer :)

1条回答
闹够了就滚
2楼-- · 2019-05-31 03:29

First of all, the command line tool that PyCharm is running is pip, which will install and download the following package:

https://pypi.python.org/pypi/PyGObject/2.28.3

As you can read, this refers to the old pygtk (Gtk 2.0) bindings for the internal object framework (last update was in 2011).

I'm pretty sure you want the PyGObject project that supports Gtk 3.0, the GUI one (terrible name I know, as they are totally different projects with the same name).

It doesn't matter if you are in PyCharm or not, you should install the library as the website does it, because PyGObject are dynamic Python bindings on top of native (compiled) C library.

I see you're in a Windows OS. You need to go to the main website:

https://wiki.gnome.org/Projects/PyGObject

You can read in the Downloads section Windows installers with Gtk3 support

And download and install the latest installer. At the time of writing:

pygi-aio-3.18.2_rev4-setup.exe

查看更多
登录 后发表回答