os system command not found
Hi all! I installed a external program called infomap using the classical procedure ./configure make sudo make install and it works perfectly in Terminal (Os x) using both bash and tcsh shell admins-macbook-pro-2:~ unil$ infomap-build Usage: infomap-build [-w working_dir] [-p param_file] [-D var_1=val_1 ... -D var_N=val_N] (-s single_corpus_file | -m multi_file_list) but when I call it from python using os.system or subprocess.call I get the message "sh: infomap-build: command not found". Do you know why? Many thanks Davide -- http://mail.python.org/mailman/listinfo/python-list
Re: os system command not found
On 14 Gen, 13:16, Steven D'Aprano wrote: > On Wed, 14 Jan 2009 02:25:52 -0800, codicedave wrote: > > Hi all! > > I installed a external program called infomap using the classical > > procedure > > > ./configure > > make > > sudo make install > > > and it works perfectly in Terminal (Os x) using both bash and tcsh > > shell > > What happens when you call it using the sh shell (which is not > necessarily aliased to bash)? > > [...] > > > but when I call it from python using os.system or subprocess.call I > > get the message "sh: infomap-build: command not found". > > > Do you know why? > > Possibly sh uses a different path to bash and can't find infomap-build. > > -- > Steven in infocmpinfotocap installer indent infokeyinstallinstmodsh indxbibinfomap-build install-info instruments info infomap-installinstall_name_tool sh-3.2$ infomap-build Usage: infomap-build [-w working_dir] [-p param_file] [-D var_1=val_1 ... -D var_N=val_N] (-s single_corpus_file | -m multi_file_list) sh-3.2$ I am not able to figure out why.. any idea? Thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: os system command not found
On 14 Gen, 15:30, Daniel da Silva wrote: > On Jan 14, 5:25 am, codicedave wrote: > > > > > Hi all! > > I installed a external program called infomap using the classical > > procedure > > > ./configure > > make > > sudo make install > > > and it works perfectly in Terminal (Os x) using both bash and tcsh > > shell > > > admins-macbook-pro-2:~ unil$ infomap-build > > > Usage: infomap-build [-w working_dir] [-p param_file] > > [-D var_1=val_1 ... -D var_N=val_N] > > (-s single_corpus_file | -m multi_file_list) > > > > > but when I call it from python using os.system or subprocess.call I > > get the message "sh: infomap-build: command not found". > > > Do you know why? > > > Many thanks > > > Davide > > Type "which infomap-build" from the command line to find out where > infomap-build is. Thank you all guys I tried to use "which" command and found it in /usr/local/bin it seemed to work but at the end I think there is a dependency problem now it can not find another program called by infomap-build bin/sh: prepare_corpus: command not found make: *** [/tmp/unil/infomap_working_dir/prova/wordlist] Error 127 (take a look above) Process begun ../files/filename.txt.sst.clean Sourcing param file "/usr/local/share/infomap-nlp/default-params" Sourcing extra param file "/tmp/infomap-build.1eD7KR" Contents are: Removing extra param file WORKING_DATA_DIR = "/tmp/unil/infomap_working_dir/prova" CORPUS_DIR = "../files" CORPUS_FILE = "../files/filename.txt.sst.clean" FNAMES_FILE = "" ROWS = "2" COLUMNS = "1000" SINGVALS = "100" SVD_ITER = "100" PRE_CONTEXT_SIZE = "30" POST_CONTEXT_SIZE = "30" WRITE_MATLAB_FORMAT = "0" VALID_CHARS_FILE = "/usr/local/share/infomap-nlp/valid_chars.en" STOPLIST_FILE = "/usr/local/share/infomap-nlp/stop.list" COL_LABELS_FROM_FILE = "0" COL_LABEL_FILE = "" echo "Making datadir" Making datadir mkdir -p /tmp/unil/infomap_working_dir/prova == Building target: /tmp/unil/infomap_working_dir/prova/wordlist Prerequisites: ../files/filename.txt.sst.clean Wed Jan 14 17:43:21 CET 2009 .. prepare_corpus \ -cdir "../files" \ -mdir "/tmp/unil/infomap_working_dir/prova" \ -cfile "../files/filename.txt.sst.clean" \ -fnfile "" \ -chfile "/usr/local/share/infomap-nlp/valid_chars.en" \ -slfile "/usr/local/share/infomap-nlp/stop.list" \ -rptfile "" /bin/sh: prepare_corpus: command not found make: *** [/tmp/unil/infomap_working_dir/prova/wordlist] Error 127 any idea? thanks -- http://mail.python.org/mailman/listinfo/python-list
