Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.5k views
in Technique[技术] by (71.8m points)

windows - Python cannot install PyGObject

I try install pygobject by pip

pip install --user PyGObject

but I doesn't work:

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 20, in <module>
      File "C:UsersAAppDataLocalTemppip-build-phby_jwbPyGObject
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:UsersAAppDataLocalTemppip-build-phby_jwbPyGObject

My python version v3.5.0:374f501f4567, Now I work on windows 7

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since February 2017, you can install pygobject directly through pip: pip install pygobject. It requires some packages to be installed though.

Before that, it took a while, but it was possible to install pygobject with pip, since this commit.

pygobject wasn't on pypi though, so you had to specify the git or tarball URL:

  • git+https://git.gnome.org/browse/pygobject
  • https://download.gnome.org/sources/pygobject/3.22/pygobject-3.22.0.tar.xz

The latter only works with pygobject 3.22+, which should have happenned around mid-september 2016. (3.21.1 should be the first pip-installable development release)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...