Installing PlasmaPy

Note

If you would like to contribute to PlasmaPy, please refer to the instructions on installing PlasmaPy for development.

Requirements

PlasmaPy requires Python version 3.6 or newer. PlasmaPy requires the following packages for installation:

PlasmaPy also depends on the following packages for optional features:

Installing PlasmaPy

Installation with conda

We highly recommend installing PlasmaPy from a Python environment created using Conda. Conda allows us to create and switch between Python environments that are isolated from each other and the system installation (in contrast to this xkcd).

After installing conda, create a PlasmaPy environment by running:

conda create -n env_name python=3.8 plasmapy -c conda-forge

where env_name is replaced by the name of the environment. To activate this environment, run:

conda activate env_name

Using pip

To install the most recent release of PlasmaPy on PyPI with pip into an existing Python environment with both required and optional dependencies, run

pip install plasmapy[all]

PlasmaPy may be installed with the required but not the optional dependencies with the following command, though this may result in an ImportError when using certain specialized functionality.

pip install plasmapy

Building and installing from source code

Obtaining source code

Stable release

The source code for the most recent stable release of PlasmaPy can be downloaded from PyPI or from Zenodo.

Development version on GitHub

If you have git installed on your computer, you may clone PlasmaPy’s GitHub repository and access source code from the most recent development version by running:

git clone https://github.com/PlasmaPy/PlasmaPy.git

The repository will be cloned inside a new subdirectory called PlasmaPy.

If you do not have git installed on your computer, then you may download the most recent source code from PlasmaPy’s GitHub repository by selecting “Clone or Download”, which will give you the option to download a zip file.

Note

Cloning a repository with HTTPS as above is recommended, but you may also clone a repository using SSH as a more secure alternative.

Note

The How to Contribute guide has instructions on how to fork a repository and create branches so that you may make pull requests.

Building and installing

In the PlasmaPy directory, run

python setup.py install

or

pip install .