Tags:
create new tag
, view all tags
-- CorentinSanchez - 2017-09-13

Si je rentre ce code directement dans la console, pas de problème ça marche, ça met à jour les variables d'environnement...

Mais en venant de python.... marche pas (enfin si, il dit coucou smile )

Il n'y a aucune erreur, mais les variables ne sont pas mises à jour... Pire que ça, ça efface leur contenu !

import os
import sys
import subprocess
subprocess.call("echo coucou",shell=True)
subprocess.call("export SPARK_HOME=/usr/lib/spark",shell=True)
subprocess.call("export PYTHONPATH=$SPARK_HOME/python/:$PYTHONPATH",shell=True)
subprocess.call("export PYTHONPATH=$SPARK_HOME/python/lib/py4j-0.10.4-src.zip:$PYTHONPATH",shell=True)
subprocess.call("echo $PYTHONPATH",shell=True)

J'ai aussi essayé d'appeler un script.sh depuis python, qui ferait la meme chose : ça marche pas non plus

SOLUTION

Topic revision: r2 - 2017-09-14 - CorentinSanchez
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback