Python and pip on PMSS
On a Pulsed Media seedbox you can install and run your own Python tools without root. Python 3, pip and the venv module are part of the package set that PMSS, Pulsed Media's open-source seedbox software, installs on Debian 11, 12 and 13, and a virtual environment in your home directory takes one command. If pip answers with cannot execute: required file not found, the same virtual environment is the way around it; the cause is explained below.
Install a Python tool in a virtual environment
Log in over SSH and create a virtual environment (venv) for the tool. Replace mytool with any name you like and PACKAGE with the package name from the tool's documentation:
python3 -m venv ~/venvs/mytool ~/venvs/mytool/bin/python -m pip install PACKAGE
The venv is a directory with its own copy of pip, so installs go there and nowhere else. A fresh venv took 13 MB on a Debian 13 test machine; whatever you install into it counts toward your storage like any other file. The venv uses the server's Python, and python3 --version shows which one that is.
Commands the package installs land in ~/venvs/mytool/bin/ and run from there by their full path:
~/venvs/mytool/bin/TOOL --help
To upgrade the tool later, run the same install line with --upgrade before the package name. To remove it, delete the directory.
Run it without typing the full path
There are two ways.
Activate the venv for the current session:
source ~/venvs/mytool/bin/activate
Activation puts the venv's bin directory first in your PATH, so TOOL, python and pip now mean the venv's own copies. deactivate undoes it. Activation applies only to the shell you ran it in; a new login starts without it.
Link the command into ~/bin for something you use every day:
mkdir -p ~/bin ln -s ~/venvs/mytool/bin/TOOL ~/bin/TOOL
Your shell adds ~/bin to PATH when it starts, and only if the directory exists, so log out and back in after creating it. The link has one limit: by default ~/bin is searched after the system directories, so a link named like a system command, such as pip or python3, is not reached. Give it a name the system does not use, or activate the venv instead.
Cron reads none of this. In a crontab, call the tool by its full path in the venv; Fixing command not found in cron jobs explains why.
Why not install with pip outside a venv
On Debian 12 and 13 the system Python is marked as externally managed: its library directory holds a file named EXTERNALLY-MANAGED. pip reads that file and refuses to install into that Python unless it runs inside a virtual environment. The venv is the route the rule points to, and it works the same on Debian 11. It also keeps your packages apart from the ones the system's own programs depend on, so a package you upgrade cannot break them.
pip says "cannot execute: required file not found"
-bash: /usr/local/bin/pip: cannot execute: required file not found
The file exists. The message comes from bash, and it is about the first line of that file, which names the program that should run it. That program is gone. An old pip installed for Python 2 typically begins with #!/usr/bin/python, and current Debian releases do not install a /usr/bin/python by default. A launcher left behind by an older Python keeps pointing at it.
Two commands show what is happening:
type -a pip head -1 "$(command -v pip)"
type -a lists every pip your shell can find, in the order it tries them; the first one is the one that runs. head -1 prints that file's first line, and a path to a Python that does not exist confirms the cause. On a Debian 13 test machine a launcher starting with #!/usr/bin/python gave exactly this message, with exit code 127.
Putting a working pip in ~/bin does not help on its own: the system directories come first, /usr/local/bin ahead of /usr/bin, so the old launcher still wins. You do not need to work around it. A venv's pip, run as ~/venvs/mytool/bin/python -m pip or after source ~/venvs/mytool/bin/activate, never touches the launcher in /usr/local/bin.
The launcher sits in a system directory, so only root can move it. If a system command should work and does not, open a ticket with the output of the two commands above.
If the launcher has been moved while your session was open, bash may keep trying the old path and print No such file or directory. Run hash -r, or log out and back in, and the shell looks the command up again.
At Pulsed Media
PMSS is open source, so the order your shell searches is in its code rather than a guess. The ~/.bashrc it manages builds PATH each time your shell starts: six system directories first, from /usr/local/sbin to /bin, then ~/.bin, ~/bin and ~/.local/bin, each only if it exists. That order is why a stale launcher in /usr/local/bin beats a command of the same name in your home directory, and why an activated venv, which puts its own directory in front, is not affected. Your own settings, including any change to PATH, go in ~/.bashrc.user, which loads after this step; Shell customization on PMSS explains it.
PMSS uses venvs for its own Python software too: it installs pyLoad and FlexGet into virtual environments of their own. Using Pulsed Media AI Credits on Any Linux Server sets up its example Python client the same way.
The smallest Pulsed Media seedbox on the plans page, M1000 SSD 230G, has 230 GiB of SSD storage, 2 CPU cores and 1 GB of RAM for 1.99€ a month excl. VAT on monthly billing. It runs the same PMSS platform this page describes, with Python 3, pip and venv already installed. See all plans.
See also
- Shell customization on PMSS — where your own aliases and environment variables go
- Fixing command not found in cron jobs — why cron cannot find tools in your home directory
- Install Media Stack — media apps for your seedbox; its SABnzbd fix recreates a venv
- Using Pulsed Media AI Credits on Any Linux Server — another Python venv walkthrough
- Seedbox — Pulsed Media seedbox overview and plans