os system command not found

C

codicedave

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)
<model_tag>


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
 
S

Steven D'Aprano

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.
 
C

codicedave

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.

in infocmp infotocap installer
indent infokey install instmodsh
indxbib infomap-build install-info instruments
info infomap-install install_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)
<model_tag>

sh-3.2$

I am not able to figure out why..

any idea?

Thanks
 
D

Diez B. Roggisch

codicedave said:
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.

in infocmp infotocap installer
indent infokey install instmodsh
indxbib infomap-build install-info instruments
info infomap-install install_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)
<model_tag>

sh-3.2$

I am not able to figure out why..

any idea?

How about you give the full path to the executable? Might be that the PATH
isn't set correctly. If you installed the software by yourself, it is very
likely that it ended up in

/usr/local/bin

instead of /usr/bin, and the former might not be part of the PATH-variable.

Diez
 
D

Daniel da Silva

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)
       <model_tag>

 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.
 
C

codicedave

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)
       <model_tag>
 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

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 = "20000"
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,282
Latest member
RoseannaBa

Latest Threads

Top