简体   繁体   中英

How to install PyGObject through PyCharm

I tried to install PyGobject through PyCharm but when I click on install package i will get this window: 在此处输入图片说明

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 :)

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM