diff --git a/UD_any/data/pretrainEmbeddings.py b/UD_any/data/pretrainEmbeddings.py
index 38175676654541f91422426f15e5867afba21d68..7e1d9f11bd0097190210df73e02905e0c18cf3e5 100755
--- a/UD_any/data/pretrainEmbeddings.py
+++ b/UD_any/data/pretrainEmbeddings.py
@@ -18,10 +18,15 @@ if __name__ == "__main__" :
   splited = os.path.splitext(pathToFile)
   target = sys.argv[3]
 
-  if which("word2vec") is None or which("udpipe") is None :
+  if which("word2vec") is None :
+    print("word2vec not installed")
     exit(0)
 
-  p = subprocess.Popen("udpipe --output=horizontal none %s > in.text && rm in.text"%pathToFile, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
+  if which("udpipe") is None :
+    print("udpipe not installed")
+    exit(0)
+
+  p = subprocess.Popen("udpipe --output=horizontal none %s > in.text"%pathToFile, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
   p.wait()
 
   args = [
@@ -38,6 +43,7 @@ if __name__ == "__main__" :
     "-min-count 2",
     "-train in.text",
     "-output %s"%target,
+    "&& rm in.text"
   ]
 
   p = subprocess.Popen(" ".join(args), stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)