From 781f2a2ccfe4760564ff5341afda5dbafad1b6d5 Mon Sep 17 00:00:00 2001 From: medusa Date: Fri, 12 Jan 2024 07:16:08 +0000 Subject: [PATCH] Add projects/mkdocs.md --- projects/mkdocs.md | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 projects/mkdocs.md diff --git a/projects/mkdocs.md b/projects/mkdocs.md new file mode 100644 index 0000000..2d16c64 --- /dev/null +++ b/projects/mkdocs.md @@ -0,0 +1,75 @@ +# Setting Up a Virtual Environment for KnowledgeBase-Tech Hugo Site + +## Update PATH Environment Variable + +Before installing `virtualenv`, ensure your PATH includes the directory where Python packages are installed. If you see a message like "The script virtualenv is installed in '/home/medusa/.local/bin' which is not on PATH," you'll need to update your PATH. Add the following line to your `.bashrc` or `.profile` file: + +```bash +export PATH="$HOME/.local/bin:$PATH" +``` + +Then, reload your profile: + +```bash +source ~/.bashrc +``` + +or for a login shell: + +```bash +source ~/.profile +``` + +## Install Virtual Environment + +Ensure Python and pip are installed, then install `virtualenv`: + +```bash +pip3 install virtualenv +``` + +## Create the Virtual Environment + +Create a virtual environment named `KnowledgeBase-Tech_env`: + +```bash +virtualenv KnowledgeBase-Tech_env +``` + +## Activate the Virtual Environment + +To start using the virtual environment: + +```bash +source KnowledgeBase-Tech_env/bin/activate +``` + +## Install Dependencies + +While the environment is active, install any required packages: + +```bash +pip install +``` + +## Freeze Requirements + +To keep track of your project's dependencies, you can freeze the installed packages into a `requirements.txt` file: + +```bash +pip freeze > requirements.txt +``` + +This file can be used to install the exact versions of the required packages on other setups or by other developers working on the project. + +## Deactivate the Virtual Environment + +When you're done working, deactivate the environment: + +```bash +deactivate +``` + +## Working with the Environment + +Remember to activate the `KnowledgeBase-Tech_env` environment every time you work on the KnowledgeBase-Tech Hugo site. This ensures all dependencies are isolated to this specific project. \ No newline at end of file