Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

a snake that runs. execute python files without packaging or installation

Project description

python, but with running.

ferret provides a new shebang line for your python script that will install dependencies into a fresh venv - saving you the hassle of packaging and distribution. ferret lets you focus on writing just the code you need without sacrificing libraries.


  • Install ferret on the target environment:
pip install ferret # Warning: this will work with a python3 venv, but not a virtualenv (as used by pipsi)
  • Replace your shebang line with this:
#! /usr/bin/env ferret
  • Declare your dependencies in your module’s docstring:
A helpful description about your module

- requests == 2.18.4

When you run a script with ferret, it parses the file for dependency declarations, and prepares a venv to match. The environments are kept under ~/.local/ferret/venvs (you can safely delete the entire contents of that folder).


Once you’ve installed ferret, take it for a spin:

cat > << EOF
#! /usr/bin/env ferret
Gets my IP from

- requests == 2.18.4


import requests

response = requests.get('')
chmod +x

The first time you run the script, ferret will set up a venv and install requests in it. Subsequent runs will re-use that environment.

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 ferret, version 0.8.0
Filename, size File type Python version Upload date Hashes
Filename, size ferret-0.8.0-py3-none-any.whl (7.0 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size ferret-0.8.0.tar.gz (3.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