Claude-Code-Slash-Commands
/
commands
/sysadmin
/linux-desktop
/python-environments
/identify-python-environments.md
A newer version of the Gradio SDK is available:
6.2.0
Python Environment Manager Identification
You are helping the user identify their system Python installation and all Python environment managers in use.
Your tasks:
Identify system Python:
- System Python version:
python3 --version - System Python location:
which python3 - Check if python (unversioned) exists:
which python - Python paths:
python3 -c "import sys; print(sys.executable)" - List all Python installations:
which -a python python3 python2
- System Python version:
Check for pyenv:
- Check if installed:
which pyenv - If installed:
- Version:
pyenv --version - Root directory:
echo $PYENV_ROOTor default~/.pyenv - Installed Python versions:
pyenv versions - Global Python:
pyenv global - Local Python (if set):
pyenv local - Check if properly initialized in shell:
grep -r "pyenv init" ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null
- Version:
- Check if installed:
Check for Conda/Miniconda/Anaconda:
- Check if conda is installed:
which conda - If installed:
- Version:
conda --version - Conda info:
conda info - Base environment location:
echo $CONDA_PREFIX - List environments:
conda env list - Current environment:
echo $CONDA_DEFAULT_ENV - Check initialization:
grep -r "conda initialize" ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null
- Version:
- Check if conda is installed:
Check for Mamba:
- Check if installed:
which mamba - If installed:
- Version:
mamba --version - Environments:
mamba env list
- Version:
- Check if installed:
Check for Poetry:
- Check if installed:
which poetry - If installed:
- Version:
poetry --version - Config location:
poetry config --list - Virtual environment settings:
poetry config virtualenvs.path
- Version:
- Check if installed:
Check for pipenv:
- Check if installed:
which pipenv - If installed:
- Version:
pipenv --version - Environment variable settings:
echo $PIPENV_VENV_IN_PROJECT
- Version:
- Check if installed:
Check for virtualenv/venv:
- Check if virtualenv is installed:
which virtualenv - Check for virtualenvwrapper:
which virtualenvwrapper.sh - If virtualenvwrapper found:
- Check workon home:
echo $WORKON_HOME - List environments:
lsvirtualenv(if available)
- Check workon home:
- Check if virtualenv is installed:
Check for other Python version managers:
- asdf with Python plugin:
which asdfandasdf plugin list | grep python - pythonz:
which pythonz - Check for manual Python installations in common locations:
/usr/local/bin/python*/opt/python*~/.local/bin/python*
- asdf with Python plugin:
Analyze pip installations:
- System pip:
pip3 --version - Pip location:
which pip3 pip - User site packages:
python3 -m site --user-site - List globally installed packages:
pip3 list --user
- System pip:
Report summary:
- System Python version and location
- All detected environment managers with versions
- Which manager is currently active (if any)
- Any conflicts or issues detected (e.g., multiple managers competing)
- Recommendations:
- If no environment manager is detected, suggest installing one (pyenv or conda)
- If multiple managers are detected, explain their different use cases
- Suggest best practices for the detected setup
- Warn about potential PATH conflicts
Important notes:
- Don't use sudo for these checks (environment managers are typically user-level)
- Be clear about which Python is currently active vs. available
- Explain the difference between system Python and managed versions
- If shell initialization is missing for detected managers, point that out