Virtualenv on Ubuntu with no site-packages

后端 未结 5 2080
野性不改
野性不改 2020-12-13 07:33

I\'ve been using virtualenv lately while developing in python. I like the idea of a segregated development environment using the --no-site-packages option, but doing this wh

5条回答
  •  臣服心动
    2020-12-13 07:53

    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.

    More detailed information on how the links are setup can be found in this answer

提交回复
热议问题