Skip to content

Additional functionality #45

@artgoldberg

Description

@artgoldberg

virtualenv-api is quite useful. Thanks.

I presume it's possible to use a VirtualEnvironment() from the Python that created the VirtualEnvironment(). The code would look like this, for example:

env = VirtualEnvironment('/path/to/environment/name')
env.install('package_foo')
# modify sys.path to use env
# now import in env's context
import bar
# perhaps modify sys.path to stop using env

If so, these two methods would be helpful:

env.activate()      # modify sys.path so that imports occur in env's context
env.deactivate()    # undo env.activate()

Thanks, Arthur

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions