Skip to main content

Provides a simple means for an application, without restarting, to temporarily install and use its runtime requirements

Project description

VirtualEnvOnDemand provides a simple means for an application, without restarting, to temporarily install and use its runtime requirements.

The primary means to accomplish this is to call “VirtualEnvOnDemand.enableOnDemandImporter()” which will load the hook into the importer. If an import fails, it will attempt to fetch the corrosponding module and install into current runtime.

You can also explicitly create environments and install packages into them (adding to current runtime). See documentation for more details.

Documentation

Can be found at:

https://htmlpreview.github.io/?https://raw.githubusercontent.com/kata198/VirtualEnvOnDemand/master/doc/VirtualEnvOnDemand.html

Example:

The following example shows using “enableOnDemandImporter” to automatically fetch and install to current runtime any unavailable imports.

import sys

from VirtualEnvOnDemand import enableOnDemandImporter

# Activate the hook

enableOnDemandImporter()

# The following imports are not available, and will be installed into current runtime

import IndexedRedis

from AdvancedHTMLParser.exceptions import *

if __name__ == ‘__main__’:

sys.stdout.write(‘IndexedRedis version: ‘ + IndexedRedis.__version__ + ‘\n’)

import AdvancedHTMLParser

sys.stdout.write(‘AdvancedHTMLParser version: ‘ + AdvancedHTMLParser.__version__ + ‘\n’)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

VirtualEnvOnDemand-2.0.0.tar.gz (22.3 kB view details)

Uploaded Source

File details

Details for the file VirtualEnvOnDemand-2.0.0.tar.gz.

File metadata

File hashes

Hashes for VirtualEnvOnDemand-2.0.0.tar.gz
Algorithm Hash digest
SHA256 fdddb084b0d473f471801c9b1becaca9a96b2298040d72e04317b32aea5f0ab2
MD5 a5a04f886b9846410ad06e2deda0b6e9
BLAKE2b-256 63721b0ef468a1a8f7ee84a1d8ad0c48efd6f2847954bdd01fc29856b9a2f4ba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page