Setup
Learn how to set up your custom book project.
Prerequisites
Ensure the following prerequisites are met and dependencies are installed before proceeding.
1. Python 3.11+
pyenv (recommended)
Pyenv manages Python versions and project dependencies with the pyenv-virtualenv plugin.
Follow the installation steps for pyenv.
Follow the installation steps for pyenv-virtualenv.
Python can be installed with pyenv in the following way:
pyenv install 3.112. Git
3. Docker
4. pipx
5. Poetry
6. Cookiecutter
Setting Up Your Project
Set up your project using the Template, a tool designed to simplify the creation of books.
1. Clone and Initialize
Clone the Template from GitHub and initialize your project with Cookiecutter:
Enter the following project details or press Enter to keep the defaults:
Project Name
The name of your project.
Sample Book
Project Slug
A URL-friendly version of the project name. If not provided, this will be derived from the project name.
sample_book
Project Description
A short description of the project.
A short description of the project.
Author Name
You or your organization's name.
Kognitos
Initial Version
Initial project version.
0.1.0
2. Enter Project Directory
Navigate into the new project directory. Replace project_slug with your own Project Slug from the previous step:
3. Create a Virtual Environment (recommended)
We recommend creating a virtual environment to isolate and manage your project dependencies.
1. Configure Poetry to create the virtual environment inside the project’s root directory:
2. Create a virtual environment:
Setting your local pyenv version
If you are using pyenv and encounter the following error:
Run the following command to set the local pyenv version for the current directory:
3. Activate the virtual environment
Run poetry shell or manually activate the environment using the following commands:
Note: To later exit the virtual environment later, run
deactivate.
4. Install dependencies
Last updated
Was this helpful?
