SkillAgentSearch skills...

Pew

A tool to manage multiple virtual environments written in pure python

Install / Use

/learn @pew-org/Pew
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Pew - Python Env Wrapper

PyPi version CI test status PyPi

Releases & changelog

Python Env Wrapper is a set of commands to manage multiple virtual environments. Pew can create, delete and copy your environments, using a single command to switch to them wherever you are, while keeping them in a single (configurable) location.

Virtualenvs makes it easier to work on more than one project at a time without introducing conflicts in their dependencies.

Pew is completely shell-agnostic and thus works on bash, zsh, fish, powershell, etc.

Installation

Nix (Linux and Macos)

You can use Nix to install Pew on Nixos as well as other Linux distributions or Macos:

nix-env --install --attr pew

Arch linux

For Archlinux, there's an AUR package

Pypi

Pew and its dependencies rely on a couple of features of pip/setuptools which might not be available on old versions. In case your distribution doesn't ship with one recent enough, you'll probably want to run pip install --upgrade pip before the installation.

If you cannot upgrade the version of setuptools on your system, and one of the packages listed below is of no use to you, I suggest to use pipsi rather than plain pip

pipsi install pew

See the troubleshooting section, if needed.

Usage

Which SHELL is Pew going to use?

Ok, Pew is shell-agnostic, but how is your shell going to be selected?

Look for the SHELL environment variable: on most unix-like systems it's already defined in a login shell, and you can verify it with commands like:

env | grep SHELL

or

python3 -c 'import os;print(os.environ.get("SHELL","No shell defined"))'

Since that variable is not commonly used on Windows, we're detecting the parent process from which pew has been invoked and use that as the user's preferred shell. If CMDER_ROOT is defined this will select Cmder (a custom configuration of cmd.exe).

In all other cases we default instead to sh.

Windows/Cygwin notes

A python installed from the normal .exe file behaves differently from a python installed inside Cygwin. For this reason if you want to use Pew inside a Cygwin shell, you should use a Cygwin python, and if you want to use it inside Powershell, you should use your normal Python install, and avoid a Cygwin one.

Common workflow

You can create a new virtualenv, with a non-default python and specifying some packages to be installed in it, like this:

~> pew new --python=pypy3 -i django myproject
created virtual environment PyPy3.6.9.final.0-64 in 817ms
creator PyPy3Posix(dest=/home/tadej/.local/share/virtualenvs/myproject, clear=False, global=False)
seeder FromAppData(extra_search_dir=/usr/share/python-wheels,download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/tadej/.local/share/virtualenv)
    added seed packages: pip==21.2.1, setuptools==57.4.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
Collecting django
Downloading Django-3.2.7-py3-none-any.whl (7.9 MB)
    |████████████████████████████████| 7.9 MB 1.8 MB/s
Collecting asgiref<4,>=3.3.2
Downloading asgiref-3.4.1-py3-none-any.whl (25 kB)
Collecting pytz
Downloading pytz-2021.1-py2.py3-none-any.whl (510 kB)
    |████████████████████████████████| 510 kB 10.6 MB/s
Collecting sqlparse>=0.2.2
Downloading sqlparse-0.4.2-py3-none-any.whl (42 kB)
    |████████████████████████████████| 42 kB 833 kB/s
Collecting typing-extensions
Downloading typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Installing collected packages: typing-extensions, sqlparse, pytz, asgiref, django
Successfully installed asgiref-3.4.1 django-3.2.7 pytz-2021.1 sqlparse-0.4.2 typing-extensions-3.10.0.2
WARNING: You are using pip version 21.2.1; however, version 21.2.4 is available.
You should consider upgrading via the '/home/tadej/.local/share/virtualenvs/myproject/bin/pypy3 -m pip install --upgrade pip' command.
Launching subshell in virtual environment. Type 'exit' or 'Ctrl+D' to return.

Once inside, you can check the current Python version, list the packages present in its python's site-packages directory, and install additional packages like this:

myproject ~> python -V
Python 3.6.9 (831ff17f8cd1, May 26 2021, 11:41:48)
[PyPy 7.3.1 with GCC 10.3.1 20210422 (Red Hat 10.3.1-1)]
myproject ~> pew lssitepackages
/home/tadej/.local/share/virtualenvs/myproject/site-packages/Django-3.2.7.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/__pycache__
/home/tadej/.local/share/virtualenvs/myproject/site-packages/_distutils_hack
/home/tadej/.local/share/virtualenvs/myproject/site-packages/_virtualenv.pth
/home/tadej/.local/share/virtualenvs/myproject/site-packages/_virtualenv.py
/home/tadej/.local/share/virtualenvs/myproject/site-packages/asgiref
/home/tadej/.local/share/virtualenvs/myproject/site-packages/asgiref-3.4.1.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/backports
/home/tadej/.local/share/virtualenvs/myproject/site-packages/backports.entry_points_selectable-1.1.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/clonevirtualenv.py
/home/tadej/.local/share/virtualenvs/myproject/site-packages/distlib
/home/tadej/.local/share/virtualenvs/myproject/site-packages/distlib-0.3.3.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/distutils-precedence.pth
/home/tadej/.local/share/virtualenvs/myproject/site-packages/django
/home/tadej/.local/share/virtualenvs/myproject/site-packages/easy-install.pth
/home/tadej/.local/share/virtualenvs/myproject/site-packages/filelock
/home/tadej/.local/share/virtualenvs/myproject/site-packages/filelock-3.1.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_metadata
/home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_metadata-4.8.1.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_resources
/home/tadej/.local/share/virtualenvs/myproject/site-packages/importlib_resources-5.2.2.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pew.egg-link
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pip
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pip-21.2.1.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pip-21.2.1.virtualenv
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pkg_resources
/home/tadej/.local/share/virtualenvs/myproject/site-packages/platformdirs
/home/tadej/.local/share/virtualenvs/myproject/site-packages/platformdirs-2.4.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pytz
/home/tadej/.local/share/virtualenvs/myproject/site-packages/pytz-2021.1.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools
/home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools-57.4.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/setuptools-57.4.0.virtualenv
/home/tadej/.local/share/virtualenvs/myproject/site-packages/six-1.16.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/six.py
/home/tadej/.local/share/virtualenvs/myproject/site-packages/sqlparse
/home/tadej/.local/share/virtualenvs/myproject/site-packages/sqlparse-0.4.2.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/typing_extensions-3.10.0.2.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/typing_extensions.py
/home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv
/home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv-20.8.1.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/virtualenv_clone-0.5.7.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel
/home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel-0.36.2.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/wheel-0.36.2.virtualenv
/home/tadej/.local/share/virtualenvs/myproject/site-packages/zipp-3.6.0.dist-info
/home/tadej/.local/share/virtualenvs/myproject/site-packages/zipp.py
myproject ~> pip install pdbpp
Collecting pdbpp
Downloading pdbpp-0.10.3-py2.py3-none-any.whl (23 kB)
Collecting fancycompleter>=0.8
Downloading fancycompleter-0.9.1-py3-none-any.whl (9.7 kB)
Collecting wmctrl
Downloading wmctrl-0.4.tar.gz (5.4 kB)
Collecting pygments
Downloading Pygments-2.10.0-py3-none-any.whl (1.0 MB)
    |████████████████████████████████| 1.0 MB 2.4 MB/s
Collecting pyrepl>=0.8.2
Downloading pyrepl-0.9.0.tar.gz (48 kB)
    |████████████████████████████████| 48 kB 3.0 MB/s
Building wheels for collected packages: pyrepl, wmctrl
Building wheel for pyrepl (setup.py) ... done
Created wheel for pyrepl: filename=pyrepl-0.9.0-py3-none-any.whl size=59906 sha256=de1c4017634f07823025e3cd6db0221c5ec6eafaade32f
View on GitHub
GitHub Stars1.2k
CategoryDevelopment
Updated3mo ago
Forks81

Languages

Python

Security Score

95/100

Audited on Dec 29, 2025

No findings