Skip to content

Commit 300b5bc

Browse files
Merge pull request #892 from mrariden/docs_venv_update
add venv instructions to README.md
2 parents 9cc49ef + 7e0e6d3 commit 300b5bc

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Mxnet is no longer supported in cellpose. To use mxnet, please use v1.0.2 (not r
6161

6262
# Installation
6363

64+
You can install cellpose using conda or with native python if you have python3.8+ on your machine.
65+
6466
## Local installation (< 2 minutes)
6567

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

80-
### Instructions
82+
### Option 1: Installation Instructions with conda
8183

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

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

109111
If these suggestions fail, open an issue.
110112

113+
### Option 2: Installation Instructions with python's venv
114+
115+
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:
116+
117+
If you are using a GPU, make sure its drivers and the cuda libraries are correctly installed.
118+
119+
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`.
120+
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`.
121+
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.
122+
4. Install cellpose into the `cellpose` venv using pip with `python -m pip install cellpose`.
123+
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]'`.
124+
6. You can now run cellpose from this environment with `python -m cellpose` or `cellpose` if you are in the cellpose directory.
125+
7. To deactivate the environment, run `deactivate`.
126+
111127
### GPU version (CUDA) on Windows or Linux
112128

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

0 commit comments

Comments
 (0)