如何通过 PyCharm 安装 PyGObject [英] How to install PyGObject through PyCharm
问题描述
我试图通过 PyCharm 安装 PyGobject,但是当我点击安装包时,我会看到这个窗口:
这是命令输出"的内容:
收集 PyGObject使用缓存的 pygobject-2.28.3.tar.bz2命令 python setup.py egg_info 的完整输出:回溯(最近一次调用最后一次):文件<string>",第 1 行,在 <module> 中文件C:\Users\Gebruiker\AppData\Local\Temp\pycharm-packaging0.tmp\PyGObject\setup.py",第 272 行引发 SystemExit,'错误:无事可做,找不到 gio 并且是必不可少的.'^语法错误:无效语法---------------------------命令python setup.py egg_info"在 C:\Users\Gebruiker\AppData\Local\Temp\pycharm-packaging0.tmp\PyGObject 中失败,错误代码为 1
(如果红色文本不好阅读,我在这里输入:raise SystemExit, '错误:无事可做,找不到 gio 并且是必需的')
我希望有人知道答案:)
首先,PyCharm运行的命令行工具是pip
,会安装下载如下包:>
https://pypi.python.org/pypi/PyGObject/2.28.3
如您所见,这是指内部对象框架的旧 pygtk
(Gtk 2.0) 绑定(上次更新是在 2011 年).
我很确定你想要支持 Gtk 3.0 的 PyGObject 项目,GUI 项目(我知道这个名字很糟糕,因为它们是完全不同的同名项目).
无论您是否在 PyCharm 中,您都应该像网站一样安装该库,因为 PyGObject 是本机(已编译)C 库之上的动态 Python 绑定.
我发现您使用的是 Windows 操作系统.您需要访问主网站:
https://wiki.gnome.org/Projects/PyGObject
您可以在下载部分阅读Windows 安装程序Gtk3 支持
并下载并安装最新的安装程序.在撰写本文时:
pygi-aio-3.18.2_rev4-setup.exe
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
这篇关于如何通过 PyCharm 安装 PyGObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!