How to install PyGObject through PyCharm

瘦欲@ 提交于 2019-12-22 17:04:45

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/35181557/how-to-install-pygobject-through-pycharm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!