Skip to main content

A project for installing packages across the virtualenv boundary.

Project description!-1EAEDB.svg Documentation Status


Mork is a library designed for installing and querying python packages inside virtual environments.

🐉 See What’s Installed

>>> import mork
>>> venv = mork.VirtualEnv.from_project_path('/home/user/git/pipenv')
>>> dists = venv.get_distributions()
>>> [dist for dist in dists][:3]
[wheel 0.31.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), Werkzeug 0.14.1 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages), vistir 0.1.4 (/home/user/.virtualenvs/pipenv-MfOPs1lW/lib/python3.7/site-packages)]

🐉 Install A Package

>>> from requirementslib.models.requirements import Requirement
>>> r = Requirement.from_line("requests")
>>> venv.install(r, editable=False)

🐉 Uninstall a Package

>>> pkg = "pytz"
>>> with venv.uninstall(pkg, auto_confirm=True) as uninstall:
        if uninstall.paths:
            cleaned = pkg
>>> print("Removed package: %s" % cleaned)

🐉 Display Information about Python

>>> venv.python
>>> venv.python_version

🐉 Run Commands Inside the Virtualenv

>>> cmd ="env")
>>> [line for line in cmd.out.splitlines() if line.startswith("VIRTUAL_ENV")]
>>> cmd = venv.run_py(["import os; print(os.environ.get('VIRTUAL_ENV'))"])
Deactivating virtualenv...
>>> cmd.out
>>> with venv.activated():

Read the documentation.

Project details

Download files

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

Files for mork, version 0.1.4
Filename, size File type Python version Upload date Hashes
Filename, size mork-0.1.4-py2.py3-none-any.whl (8.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size mork-0.1.4.tar.gz (14.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page