1

Below are instructions I am following for setting environment variables:

Next you'll need to set a couple of environmental variables. You can do this at the command line or you can set it up in your computer's/master node's bash_rc/bash_profile files.

export SPARK_HOME="$HOME/Downloads/spark-1.3.1"

I open cmd.exe and type in the command above and I get 'export' is not a recognized command. How do I use cmd.exe to set SPARK_HOME? The site I am using to install pyspark is: https://plot.ly/ipython-notebooks/apache-spark/

lord12
  • 139
  • 2
  • 2
  • 4
  • This command is a LINUX command. In Windows you need to use SET SPARK_HOME="PutDirectoryHere". But take care: The path has to be in windows format as well, not the forward slash linux type of path. – Tode Jan 11 '16 at 07:41
  • 1
    Possible duplicate of [What are PATH and other environment variables, and how can I set or use them?](http://superuser.com/questions/284342/what-are-path-and-other-environment-variables-and-how-can-i-set-or-use-them) – DavidPostill Jan 11 '16 at 12:42

2 Answers2

1

Setting up an environment variable through CMD:

Open CMD

Set Spark_Home="$HOME/Downloads/spark-1.3.1"

Now test by just entering %Spark_Home% in CMD and hit enter.

1

For setting an environment variable for the current user (windows account):

  1. close your current cmd shell/terminal;
  2. access Run (press Win + R);
  3. type setx HOME %userprofile% (for example);
  4. press Enter.

Voilá, you can now reopen the cmd shell and type set HO to check all variables starting with HO.

Alternatively, if you prefer to access the window to check all of them, run:

  • %windir%\system32\rundll32.exe sysdm.cpl EditEnvironmentVariables

Note: in OP's specific case, the command for setting would be:

  • setx SPARK_HOME "%userprofile%\Downloads\spark-1.3.1"

For more information, type in cmd shell setx /?.

Armfoot
  • 225
  • 1
  • 3
  • 10