Prerequisite Guide: Setting Up Virtual Environments for MuscleX Installation

Before installing MuscleX via Conda, pip, or directly from GitHub, it’s crucial to establish a virtual environment. This step ensures your project dependencies are managed in an isolated space, preventing conflicts. This guide emphasizes Conda as the recommended tool for environment management, with venv presented as an alternative option.

⚠️ Important Consideration

Conda is highly recommended for creating virtual environments, especially since it allows for the specification of Python versions within each environment, independent of the system’s Python interpreter. This flexibility is particularly beneficial for projects requiring a specific Python version or those aiming to avoid interference with system-wide Python settings.

Why Use a Virtual Environment?

A virtual environment is necessary for installations involving:

  • Conda: When installing MuscleX from a Conda channel.

  • Pip: For installations via the Python Package Index (PyPI) or from GitHub.

  • GitHub: When installing the latest development version from the GitHub repository.

Using a virtual environment ensures a clean, controlled setup, isolating MuscleX’s dependencies from other Python projects on your system.

Alternative: venv for Python Projects

venv is a viable alternative, provided with Python 3.3 and later.

⚠️ Important Consideration

Only use venv if you are installing MuscleX via pip or GitHub, because installing MuscleX via Conda requires a Conda environment. If you are using Conda, please refer to the Conda environment setup instructions above.

Advantages of venv:

  • Built-In with Python: No need for additional installations.

Setting Up venv:

  1. Verify Python Version: Ensure you have Python 3.3 or newer by running python --version.

  2. Create a New Environment: Within your project directory:

    python -m venv myenv
    
  3. Activate the Environment:

    • Windows:

      myenv\Scripts\activate
      
    • macOS and Linux:

      source myenv/bin/activate