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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file VirtualEnvOnDemand-2.0.1.tar.gz
.
File metadata
- Download URL: VirtualEnvOnDemand-2.0.1.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce9ad93ae55759654e6ae132c9b2339d0579bc0adb4c4289f530ed3ef5ba270 |
|
MD5 | 2dc43830a6595ee5db88102e71b99afb |
|
BLAKE2b-256 | 73441edf67c2badb40a7280f520257b304e2791f8698c3acbceab61e63564a05 |