Skip to content

Installation

Michael Chirillo edited this page Jul 2, 2024 · 10 revisions

PyReconstruct can be installed on just about any major operating system. We recommend installing PyReconstruct into a virtual environment managed by Conda, and this page walks you through that process.

PyReconstruct is undergoing heavy development at the time of writing this guide, and these instructions will likely change over time. Please let us know if you have any questions or if something isn't working as expected.

Table of Contents

  1. Install with Conda
  2. Launch PyReconstruct
  3. Update PyReconstruct
  4. Uninstall PyReconstruct
  5. Development version

Install with Conda

Installing PyReconstruct with the Conda package manager is easy and Conda will take care of installing the application's dependencies for you.

1. Install Conda

If Conda isn't already present on your machine, follow the install instructions on their website. We recommend installing Miniconda, a slimmed down version of the Conda package manager, and selecting the default options during the installation process.

2. Open a terminal

  • Windows: Click START and search for Anaconda prompt

  • macOS/Linux: Search for terminal.

You should see (base) appear before the terminal prompt, indicating that the base Conda environment is active. (Please refer back to the Conda website on how to initialize Conda if you do not see (base) before your prompt.)

Note for macOS/Linux users

After installation, by default the Conda base environment is automatically activated every time a new terminal is opened. You might not want this to be the case, as it can occasionally lead to problems. To change the default behavior, simply run the following command in a terminal:

conda config --set auto_activate_base false

You can subsequently activate the base environment by running conda activate.

3. Create a virtual environment

Create a new virtual environment named "synapses" that includes Python 3.11 and git by running the following command:

conda create -n synapses python=3.11 git

If you already have git, you can remove it from the above command.

Note: You can name the virtual environment anything you'd like; however, be sure to change its name in the commands that follow.

4. Activate the virtual environment

Activate the virtual environment by running the following command:

conda activate synapses

(base) should now be changed to (synapses), indicating the virtual environment is now active in your current terminal.

5. Install PyReconstruct

Install the most recent stable version of PyReconstruct into the virtual environment by running the following command:

pip install pyreconstruct

If instead you'd like bleeding-edge PyReconstruct (i.e., access to the most up-to-date changes available in GitHub), run the following:

pip install git+https://github.com/synapseweb/pyreconstruct

(Note: If you get an error warning you that pip is not installed, install it by running the following command: conda install pip. Then try pip installing PyReconstruct again using the above command.)

Launch PyReconstruct

With the virtual environment active (see install instructions on how to activate the virtual environment with Conda), launch PyReconstruct by running the following command:

PyReconstruct

(Note the first time launching PyReconstruct might take up to a minute depending on your system. Subsequently launching the application should be quick.)

Note for Linux users

If after launching PyReconstruct you are warned that a particular version of GLIBCXX is not found, make sure the virtual environment is activated and install the following packages (depending on your distro) by running one of these commands:

conda install -c conda-forge libstdcxx-ng=12 # if on Ubuntu
conda install -c conda-forge gcc=12.1.0  # if on Archlinux

Update PyReconstruct

To update PyReconstruct, make sure the virtual environment is activated and run the following command:

PyReconstruct --update

Uninstall PyReconstruct

Uninstalling PyReconstruct is as easy as deleting the virtual environment from your machine.

If you installed PyReconstruct with Conda, delete the virtual environment named synapses using the following command:

conda remove -n synapses --all

Remember to substitute the proper name for the virtual environment if it is something other than synapses.

(If you would like to completely uninstall Conda from your machine, please follow the uninstall instructions on the Conda website.)

Development version

Please refer to this wiki page for instructions on installing the developer's version of PyReconstruct, complete with Neuroglancer and scripts for exporting groups as labels.