This project is used to show how Python can be used to replace the colors in an image.
File structure of the project is as follows:
.
├── env # Virtual environment
├── data # Directory containing images
├── nbs # Directory containing Jupyter notebooks
│ ├── 00-nb-intro.ipynb
│ └── 01-recolor-img.ipynb
├── src # Directory containing any custom modules
│ └── test.py # custom module containing test function
├── .gitignore
├── README.md # This documentation file
└── requirements.txt # File containing dependent packages of environment
- Download repository from GitHub
- Navigate to downloaded directory
- Open a command line tool (bash/zsh terminal for macOS, Git Bash or cmd for Windows) in this location (or open a terminal and navigate to the location from within the terminal)
- Check that Python is downloaded:
python3 --version
- Create a Python virtual environment in a directory we'll call
env
:python3 venv env
- Activate your Python environment:
- On Windows Git Bash cmd:
. env\Scripts\activate.bat
- On MacOS/Linux bash/zsh terminal:
source env/bin/activate
- On Windows Git Bash cmd:
- Install the project dependent packages (dependencies) into the currently activated virtual environment using the
requirements.txt
file:python3 -m pip install -r requirements.txt
- You can check that all the necessary packages and their dependencies were installed by looking at a list of all the packages installed by pip:
python3 -m pip list
- In a terminal within the project directory with your virtual environment activated, run this command to install napari and all its dependencies:
python3 -m pip install "napari[all]"
- Verify that napari installed by checking its version:
napari --version
- Open a terminal and navigate to your project directory, or open a terminal from your project directory
- Activate your virtual environment:
- On Windows Git Bash cmd:
. env\Scripts\activate.bat
- On MacOS/Linux bash/zsh terminal:
source env/bin/activate
- On Windows Git Bash cmd:
- Open a Jupyter notebook session with the virtual environment activated:
jupyter notebook