Skip to content

Commit

Permalink
Merge pull request #892 from mrariden/docs_venv_update
Browse files Browse the repository at this point in the history
add venv instructions to README.md
  • Loading branch information
carsen-stringer authored May 7, 2024
2 parents 9cc49ef + 7e0e6d3 commit 300b5bc
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Mxnet is no longer supported in cellpose. To use mxnet, please use v1.0.2 (not r

# Installation

You can install cellpose using conda or with native python if you have python3.8+ on your machine.

## Local installation (< 2 minutes)

### System requirements
Expand All @@ -77,7 +79,7 @@ cellpose relies on the following excellent packages (which are automatically ins
- [scipy](https://www.scipy.org/)
- [natsort](https://natsort.readthedocs.io/en/master/)

### Instructions
### Option 1: Installation Instructions with conda

If you have an older `cellpose` environment you can remove it with `conda env remove -n cellpose` before creating a new one.

Expand Down Expand Up @@ -108,6 +110,20 @@ If you have **issues** with installation, see the [docs](https://cellpose.readth

If these suggestions fail, open an issue.

### Option 2: Installation Instructions with python's venv

Venv ([tutorial](https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv), for those interested) is a built-in tool in python for creating virtual environments. It is a good alternative if you don't want to install conda and already have python3 on your machine. The main difference is that you will need to choose where to install the environment and the packages. Cellpose will then live in this environment and not be accessible from other environments. You will need to navigate to the environment directory and activate it each time before running cellpose. The steps are similar to the conda installation:

If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.

1. Install python3.8 or later from [python.org](https://www.python.org/downloads/). This will be the version of python that will be used in the environment. You can check your python version with `python --version`.
2. Navigate to the directory where you want to create the environment and run `python3 -m venv cellpose` to create a new environment called `cellpose`.
3. Activate the environment with `source cellpose/bin/activate` on Mac/Linux or `cellpose\Scripts\activate` on Windows. A prefix `(cellpose)` should appear in the terminal.
4. Install cellpose into the `cellpose` venv using pip with `python -m pip install cellpose`.
5. Install the cellpose GUI, with `python -m pip install cellpose[gui]`. Depending on your terminal software, you may need to use quotes like this: `python -m pip install 'cellpose[gui]'`.
6. You can now run cellpose from this environment with `python -m cellpose` or `cellpose` if you are in the cellpose directory.
7. To deactivate the environment, run `deactivate`.

### GPU version (CUDA) on Windows or Linux

If you plan on running many images, you may want to install a GPU version of *torch* (if it isn't already installed).
Expand Down

0 comments on commit 300b5bc

Please sign in to comment.