Skip to content

Commit 402dbef

Browse files
Work in progress
1 parent 89f7677 commit 402dbef

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [GraphX](#graphx)
1717
* [Pregel](#pregel)
1818
- [Setup](#setup)
19+
* [Mac](#mac)
1920
---
2021

2122
<a id="introduction" />
@@ -47,3 +48,65 @@ Pregel, originally developed by Google, is essentially a message-passing interfa
4748
<a id="setup" />
4849

4950
#### 2. Setup
51+
52+
53+
Before starting, you may need to setup your machine first. Please follow the below mentioned guides to setup Spark and Maven on your machine.
54+
55+
<a id="mac" />
56+
57+
##### 2.1. Mac
58+
59+
We have created a setup script which will setup brew, apache-spark and conda enviornment. If you are on Mac machine, you can run the following commands:
60+
61+
```bash
62+
git clone https://github.com/mohammadzainabbas/SDM-Lab-2.git
63+
cd SDM-Lab-2 && sh scripts/setup.sh
64+
```
65+
66+
<a id="linux" />
67+
68+
##### 2.2. Linux
69+
70+
If you are on Linux, you need to install [Apache Spark](https://spark.apache.org) by yourself. You can follow this [helpful guide](https://computingforgeeks.com/how-to-install-apache-spark-on-ubuntu-debian/) to install `apache spark`.
71+
72+
We also recommend you to install _conda_ on your machine. You can setup conda from [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html)
73+
74+
After you have conda, create new enviornment via:
75+
76+
```bash
77+
conda create -n spark_env python=3.8
78+
```
79+
80+
> Note: We are using Python3.8 because spark doesn't support Python3.9 and above (at the time of writing this)
81+
82+
Activate your enviornment:
83+
84+
```bash
85+
conda activate spark_env
86+
```
87+
88+
Now, you need to install _pyspark_:
89+
90+
```bash
91+
pip install pyspark
92+
```
93+
94+
If you are using bash:
95+
96+
```bash
97+
98+
echo "export PYSPARK_DRIVER_PYTHON=$(which python)" >> ~/.bashrc
99+
echo "export PYSPARK_DRIVER_PYTHON_OPTS=''" >> ~/.bashrc
100+
. ~/.bashrc
101+
102+
```
103+
104+
And if you are using zsh:
105+
106+
```zsh
107+
108+
echo "export PYSPARK_DRIVER_PYTHON=$(which python)" >> ~/.zshrc
109+
echo "export PYSPARK_DRIVER_PYTHON_OPTS=''" >> ~/.zshrc
110+
. ~/.zshrc
111+
112+
```

0 commit comments

Comments
 (0)