|
| 1 | +## Setup development environment in Ubuntu |
| 2 | + |
| 3 | +### Step 1: Install `libpq5` and `libpq-dev` |
| 4 | + |
| 5 | +1. **Update your package lists**: |
| 6 | + |
| 7 | + Open a terminal and run: |
| 8 | + ```bash |
| 9 | + sudo apt update |
| 10 | + ``` |
| 11 | + |
| 12 | +2. **Install the packages**: |
| 13 | + |
| 14 | + Run the following command to install `libpq5` and `libpq-dev`: |
| 15 | + ```bash |
| 16 | + sudo apt install libpq5 libpq-dev |
| 17 | + ``` |
| 18 | + |
| 19 | +### Step 2: Set Python to refer to Python 2 |
| 20 | + |
| 21 | +Since Python 2 is deprecated and might not be installed by default on newer systems, you'll need to ensure it is installed and set up correctly. |
| 22 | + |
| 23 | +1. **Install Python 2**: |
| 24 | + |
| 25 | + If Python 2 is not installed, you can install it using: |
| 26 | + ```bash |
| 27 | + sudo apt install python2 |
| 28 | + ``` |
| 29 | + |
| 30 | +2. **Check if Python 2 is installed**: |
| 31 | + |
| 32 | + Verify the installation by running: |
| 33 | + ```bash |
| 34 | + python2 --version |
| 35 | + ``` |
| 36 | + |
| 37 | + You should see something like: |
| 38 | + ``` |
| 39 | + Python 2.7.x |
| 40 | + ``` |
| 41 | + |
| 42 | +3. **Update the `python` command to refer to Python 2**: |
| 43 | + |
| 44 | + You might need to update the alternatives system to make `python` point to `python2`. Here’s how you can do that: |
| 45 | + |
| 46 | +- **Check current alternatives**: |
| 47 | + ```bash |
| 48 | + ls -l /usr/bin/python |
| 49 | + ``` |
| 50 | + |
| 51 | +- **Set `python` to point to `python2`**: |
| 52 | + |
| 53 | + If `/usr/bin/python` points to Python 3, you can update it using the alternatives system: |
| 54 | + |
| 55 | + ```bash |
| 56 | + sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1 |
| 57 | + ``` |
| 58 | + |
| 59 | +- **Verify**: |
| 60 | + |
| 61 | + Check again to ensure that `python` now refers to Python 2: |
| 62 | + ```bash |
| 63 | + python --version |
| 64 | + ``` |
| 65 | + |
| 66 | + It should display: |
| 67 | + ``` |
| 68 | + Python 2.7.x |
| 69 | + ``` |
| 70 | + |
| 71 | +### Step 3: Install Node |
| 72 | + |
| 73 | +Refer to [node.js download](https://nodejs.org/en/download) for options on how to install node. |
0 commit comments