本文介绍了在virtualenv中通过pip安装PyGObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际上是将旧的django应用程序从python2.7升级到python3.4。通过pip安装pygobject时,我收到了这个错误:

 收集pygobject 
使用缓存的pygobject-2.28.3.tar .bz2
从命令py完成输出setup.py egg_info:
追溯(最近的最后一次调用):
文件< string>,第20行,< module>
文件/tmp/pip-build-9dp0wn96/pygobject/setup.py,行272
raise SystemExit,'ERROR:没有办法,gio找不到,是至关重要的'
^
SyntaxError:无效语法

------------------------------- ---------
命令python setup.py egg_info失败,错误代码1在/ tmp / pip-build-9dp0wn96 / pygobject
pre>

我正在尝试将其安装在virtualenv中。我正在使用python3.4处理arch linux。



我已经安装了名为pygobject-devel 3.16.2的arch包-1但我仍然无法导入gobject python模块



这个诅咒的gio是什么?



任何帮助是受欢迎的...
提前Thanx!

解决方案

现在回答标签以上评论!
看看那里=>



确定我只是管理它!



要在virtrualenv中安装PyGObject,放弃pip。 / p>


  1. 安装PyGObject系统范围(与您的程序包管理器或手动编译)。例如,在我的情况下:

      sudo pacman -Suy python-gobject2 
    / pre>

  2. 将其链接到您的virtualenv:

      ln -s /usr/lib/python3.4/site-packages/gobject* /WHEREVER/IS/YOUR/VIRTUALENV/venv/lib/python3.4/site-packages/ 


  3. 您可能需要链接其他模块(在我的情况下是glib):

      ln -s /usr/lib/python3.4/site-packages/glib* /WHEREVER/IS/YOUR/VIRTUALENV/venv/lib/python3.4/site-packages/ 


您可能会发现有关系统范围的一些有用的信息和virtualenv安装和模块之间的交互:




I'm actually upgrading an old django app from python2.7 to python3.4. While installing pygobject via pip, I got this error:

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 "/tmp/pip-build-9dp0wn96/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 /tmp/pip-build-9dp0wn96/pygobject

I am trying to install it in a virtualenv. System-wide installation doesn't work either... I am working on arch linux with python3.4

I have installed the arch package named pygobject-devel 3.16.2-1 but I still can't import gobject python module

What is this damned missing gio?

Any help is welcomed...Thanx in advance !

解决方案

ANSWER IS NOW IN THE POST TAGGED IN COMMENT ABOVE !!!!Have a look there => Python cannot install PyGObject

Ok I just managed it !

To install PyGObject in virtrualenv, give up with pip.

  1. Install PyGObject system-wide (with your package manager or compile it manually). For example, in my case :

    sudo pacman -Suy python-gobject2
    

  2. Link it in your virtualenv :

    ln -s /usr/lib/python3.4/site-packages/gobject* /WHEREVER/IS/YOUR/VIRTUALENV/venv/lib/python3.4/site-packages/
    

  3. You might need to link some other modules (in my case glib) :

    ln -s /usr/lib/python3.4/site-packages/glib* /WHEREVER/IS/YOUR/VIRTUALENV/venv/lib/python3.4/site-packages/
    

You might find some helpful infos about system-wide and virtualenv installations and interactions between modules here :

virtualenv: Specifing which packages to use system-wide vs local

这篇关于在virtualenv中通过pip安装PyGObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-01 00:06