Skip to content

Commit

Permalink
Add pyenv and virtual environment setup instructions (#16)
Browse files Browse the repository at this point in the history
* Add pyenv instructions

* Update README.md

* Update README.md
  • Loading branch information
maishathasin authored Dec 9, 2024
1 parent 7962bce commit 1a2c089
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
The project requires python3.9 +, we will go through the installation of pyenv to easily switch and virtual environment

## Setting Up `pyenv`

`pyenv` allows you to easily switch between multiple versions of Python. Here's how to set it up:

### 1. Install pyenv

```bash
curl https://pyenv.run | bash
```

## Add pyenv to Your Shell:
Add the following lines to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):

```bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

```

## Install Python Version

Use pyenv to install Python 3.9 or later:

```bash
pyenv install 3.9.10
pyenv global 3.9.10

```

## Verify Installation
python --version

```bash
python --version

```

## Setting Up the Environment
Create and activate a virtual environment using pyenv and pyenv-virtualenv:

### Install pyenv-virtualenv:

#### On Linux:

```bash
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
```
#### On Windows:

```bash
git clone https://github.com/pyenv-win/pyenv-win.git %USERPROFILE%\.pyenv
```

## Create a Virtual Environment:

``` bash

pyenv virtualenv 3.9.10 env
```

```bash
pyenv activate env
```


## Install Packages:

Install the required packages using requirements.txt:

```
pip install -r requirements.txt
```

### Running the code
First start the super node by running the following command:<br>
`python main.py -super true`
Expand Down

0 comments on commit 1a2c089

Please sign in to comment.