diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..600d2d33badf45cc068e01d2e3c837e11c417bc4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.vscode
\ No newline at end of file
diff --git a/install-mpsd-software-environment.py b/install-mpsd-software-environment.py
index db18f24e0ed0068377cdddd4f242cc31a1b6da00..27cab91c1206c093933920c52d58ad92d63e16bb 100644
--- a/install-mpsd-software-environment.py
+++ b/install-mpsd-software-environment.py
@@ -42,20 +42,14 @@ def build_toolchains(
 
     # Checks
 
-    ## Check if current Git branch name and MPSD_SPACK_VER( If passed ) match
+    ## Check that some mpsd_spack_ver is passed.
     if mpsd_spack_ver is None:
-        mpsd_spack_ver = current_branch
-    elif current_branch != mpsd_spack_ver:
-        # Ensure that the current Git branch name matches MPSD_SPACK_VER
         raise invoke.Exit(
-            f"Error: Current Git branch name {current_branch} \n\
-            does not match argument for MPSD_SPACK_VER: {mpsd_spack_ver}"
+            "Error: MPSD_SPACK_VER not passed. Please pass the MPSD Software stack version."
         )
-
     ## Check if toolchains directory exists
-    toolchains_path = os.path.join(
-        toolchain_base_dir, mpsd_os, mpsd_spack_ver, mpsd_microarch
-    )
+    spack_env_path = os.path.join(toolchain_base_dir, mpsd_os, mpsd_spack_ver)
+    toolchains_path = os.path.join(spack_env_path, mpsd_microarch)
     if not os.path.exists(toolchains_path):
         os.makedirs(toolchains_path)
     else:
@@ -64,6 +58,10 @@ def build_toolchains(
                 f"Error: Toolchains directory {toolchains_path} already exists. \n\
                 Please remove it and try again."
             )
+    ### Clone spack-env repo at spack_env_path
+    with c.cd(spack_env_path + "/spack-environments"):
+        c.run("git clone git@gitlab.gwdg.de:mpsd-cs/spack-environments.git .")
+        c.run(f"git checkout {mpsd_spack_ver}")
     ## Check if TOOLCHAIN_LIST is valid
     available_toolchains = os.listdir("toolchains")
 
@@ -85,13 +83,14 @@ def build_toolchains(
                 )
 
     # Build toolchains
+
     log_file = f"build_toolchains_{mpsd_spack_ver}_{time.strftime('%Y%m%d-%H%M%S')}.log"
     print(f"Building at {toolchains_path}...")
     for toolchain in toolchains:
         with c.cd(toolchains_path):
             c.run(f"echo '>>>> Building {toolchain}...' | tee -a {log_file}")
             c.run(
-                f" bash {current_dir}/spack_setup.sh {flags} {toolchain}|tee -a {log_file} 2>&1"
+                f" bash {spack_env_path}/spack-environments/spack_setup.sh {flags} {toolchain}|tee -a {log_file} 2>&1"
             )
             # copy the octopus configs to the toolchain directory
             # c.run(f"cp -r {current_dir}/octopus {toolchains_path}")