Python package installed globally, but not in a virtualenv (PyGTK)

前端 未结 5 1036
礼貌的吻别
礼貌的吻别 2021-01-01 05:23

I\'m having some strange issues with PyGTK in \"virtualenv\". gtk does not import in my virtualenv, while it does import in my global python install. (I wasn\'t having this

5条回答
  •  Happy的楠姐
    2021-01-01 06:07

    If you want to include the links to the relevant system's python gtk-2.0 in the virtualenv, you can just use pip to install ruamel.venvgtk:

    pip install ruamel.venvgtk
    

    You don't have import anything, the links are setup during installation.

    This is especially handy if you are using tox, in that case you only need to include the dependency (for tox):

    deps:
        pytest
        ruamel.venvgtk
    

    and a newly setup python2.7 environment will have the relevant links included before the tests are run.

提交回复
热议问题