Installation¶
MDCraft is a Python package and can be installed using pip, the package installer for Python, or a Python package manager like Conda or Mamba. MDCraft requires Python 3.9 or later.
Prerequisites¶
Virtual environement¶
It is highly recommended that you use a virtual environment for MDCraft to prevent dependency conflicts. If you do not already have a virtual environment for MDCraft and related simulation packages and tools, you can create one for the package installer/manager you use using the instructions below.
Conda¶
Optional: Make conda-forge the default channel for dependencies:
conda config --add channels conda-forge
Create an environment named
mdcraftwith Python:conda create -n mdcraft python
Activate the environment:
conda activate mdcraft
venv¶
Create an environment named
mdcraft:python3 -m venv mdcraft
Activate the environment using one of the following commands:
source mdcraft/bin/activate # POSIX: bash or zsh
mdcraft\Scripts\activate.bat # Windows: cmd.exe
mdcraft\Scripts\Activate.ps1 # Windows: PowerShell
virtualenv¶
Create an environment named
mdcraft:virtualenv mdcraft
Activate the environment using one of the following commands:
source mdcraft/bin/activate # Linux or macOS
.\mdcraft\Scripts\activate # Windows
OpenMM¶
If you plan on using the high-performance OpenMM simulation toolkit, you must
Install from PyPI¶
Install MDCraft and required dependencies using pip:
python3 -m pip install mdcraft
Install from Anaconda¶
Install MDCraft and required dependencies using Conda:
conda install bbye98::mdcraft
Install from source¶
Grab a copy of the MDCraft repository:
git clone https://github.com/bbye98/mdcraft.git
Enter the repository directory:
cd mdcraft
Optional: The required dependencies will be installed automatically alongside MDCraft in the next step. To install all dependencies, including those used for development and unit tests, use one of the following commands:
python3 -m pip install -r requirements.txt # pip package installer
conda env update --file environment.yml # Conda/Mamba package manager
Install MDCraft (and required dependencies, if you have not already done so) using pip (even if you are using a Conda/Mamba environment):
python3 -m pip install -e .
Postrequisites¶
Try importing MDCraft in Python:
python3 -c "import mdcraft"
If no errors like ModuleNotFoundError: No module named 'mdcraft' are raised, you have successfully installed MDCraft!
Method of image charges¶
If you plan on using the method of image charges (mdcraft.openmm.system.add_image_charges()) in your OpenMM simulations, you must compile and install constvplugin or openmm-ic-plugin.