Python environmennt managementο
pipManagement tool
The pipManagement tool is a cross-platform CLI utility designed to simplify the maintenance of Python virtual environments specifically for physical chemistry workflows.
Key Featuresο
Auto-Detection: Automatically scans your
PIP_MGMT_FOLDER(defaulting to~/Python3) for valid virtual environments. No manual editing of the script is required when adding new environments.Cross-Platform: Works natively on Linux, macOS (Darwin), and Windows by detecting the correct activation paths (
bin/vsScripts/).Dependency Safety: Automatically runs
pip checkafter installations or removals to ensure your scientific stack remains consistent and free of version conflicts.Alphabetical Mapping: Automatically maps detected environments to a simple letter-based selection menu (a, b, cβ¦) sorted case-insensitively.
Usageο
Once pyphyschemtools is installed, the command is universal across all operating systems. Open your terminal (Terminal on Mac/Linux, or PowerShell/CMD on Windows) and type:
pipManagement
Configuration: Setting up PIP_MGMT_FOLDERο
By default, the tool looks for a folder named Python3 located directly in your User Home directory. If your virtual environments are stored in a different location, you must define the PIP_MGMT_FOLDER environment variable.
The tool resolves the final path by combining your Home Directory with the value of this variable:
Linux/macOS:
/home/username/+PIP_MGMT_FOLDERWindows:
C:\Users\username\+PIP_MGMT_FOLDER
π§ Linux & π macOS (Zsh/Bash)ο
On Unix-based systems, you define the variable in your shell configuration file so it is loaded every time you open a terminal.
Open your configuration file (most modern Macs use
~/.zshrc, while Linux usually uses~/.bashrc):nano ~/.zshrc #mac nano ~/.bashrc #linux
Add the following line at the end of the file:
export PIP_MGMT_FOLDER="MyCustomFolder"
Save and Exit: Press Ctrl+O, then Enter to save, and Ctrl+X to exit.
Refresh your current shell to apply the changes immediately:
source ~/.zshrc #mac source ~/.bashrc #linux
πͺ Windows (PowerShell / CMD)ο
Windows users can set this globally through the System Properties to ensure it works in both PowerShell and Command Prompt.
Press the Windows Key and type env.
Select Edit the system environment variables.
In the window that appears, click the Environment Variables button at the bottom right.
Under the User variables section (the top half), click Newβ¦.
Fill in the details:
Variable name: PIP_MGMT_FOLDER
Variable value: MyCustomFolder (e.g., Documents\PythonEnvs)
Click OK on all windows and restart any open terminal windows for the change to take effect.
π οΈ Troubleshooting on Windows If the command pipManagement is not recognized after installation, ensure that the Python Scripts folder is in your system PATH. Alternatively, you can always launch the tool manually via Python:
python -m pyphyschemtools.utils.pipManagement