LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-11-2012, 06:34 PM   #1
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Rep: Reputation: Disabled
Unhappy python2.7 not found even though its there in the /linux64/bin


Hey,
I'm installing gurobi5.0.0 on my ubuntu 11.10 machine.

I have to run the bash shell gurobi.sh from the terminal. Whenever I type
$gurobi.sh from my homefolder it shows command not found.

When I cd into /opt/gurobi500/linux64/bin (where the gurobi.sh command is placed)

and type $./gurobi.sh

It says python2.7 not found. the executable python2.7 is cleary present in the directory!
When I run ./python2.7 it works, hence there is no problem with the permissions.

Hence why cant gurobi.sh access the executable? (I even did chmod 777 python2.7)
Any help would be greatly appreciated!

Thanks!

Best,
Adwait
 
Old 05-11-2012, 06:44 PM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
You must add /opt/gurobi500/linux64/bin to the path.
 
1 members found this post helpful.
Old 05-11-2012, 06:46 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Add /opt/gurobi500/linux64/bin to your PATH variable in .profile. If you have libraries, check for the path in /etc/ld.so.config and run "sudo ldconfig".

Do you have two versions of python installed?
If you run "python --version" which version do you see?
 
Old 05-11-2012, 07:08 PM   #4
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
2.7.2. That's compatible with 2.7 right?

Quote:
Originally Posted by jschiwal View Post
Add /opt/gurobi500/linux64/bin to your PATH variable in .profile. If you have libraries, check for the path in /etc/ld.so.config and run "sudo ldconfig".

Do you have two versions of python installed?
If you run "python --version" which version do you see?
 
Old 05-11-2012, 07:11 PM   #5
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Its already added.
When I open gurobi.sh in a text editor the following is written:

#!/bin/sh

if test -z "${GUROBI_HOME}" ; then
echo
echo "Environment variable GUROBI_HOME is not set. Consult the Gurobi"
echo "Quick Start Guide for information on how to set it."
echo
fi

export PATH=$GUROBI_HOME/bin:$PATH .........................PATH variable is set, where do I check GUROBI_HOME ??
export LD_LIBRARY_PATH=$GUROBI_HOME/lib:$LD_LIBRARY_PATH
export PYTHONHOME=$GUROBI_HOME
export PYTHONPATH=$GUROBI_HOME:$PYTHONPATH

export PYTHONSTARTUP=$PYTHONHOME/lib/gurobi.py

$PYTHONHOME/bin/python2.7 $*



Quote:
Originally Posted by Ser Olmy View Post
You must add /opt/gurobi500/linux64/bin to the path.
 
Old 05-11-2012, 07:22 PM   #6
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
In your case, the variable GUROBI_HOME should point to /opt/gurobi500/linux64.

What does echo ${GUROBI_HOME} produce?
 
Old 05-11-2012, 07:23 PM   #7
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Its already pointed. I did echo $GUROBI_HOME and it gives /opt/gurobi500/linux64

Quote:
Originally Posted by Ser Olmy View Post
In your case, the variable GUROBI_HOME should point to /opt/gurobi500/linux64.

What does echo ${GUROBI_HOME} produce?
 
Old 05-11-2012, 07:32 PM   #8
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Run gurobi.sh with "bash -x". It will display each line on the console as it is executed, including the expanded contents of the variables:
bash -x /opt/gurobi500/linux64/bin/gurobi.sh
That should give you an indication as to what the problem might be.
 
Old 05-11-2012, 07:36 PM   #9
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thanks a lot for your prompt replies

I executed it:
Got the following output:

+ test -z /opt/gurobi500/linux64
+ export LD_LIBRARY_PATH=/opt/gurobi500/linux64/lib::/opt/gurobi500/linux64/lib
+ LD_LIBRARY_PATH=/opt/gurobi500/linux64/lib::/opt/gurobi500/linux64/lib
+ export PYTHONHOME=/opt/gurobi500/linux64
+ PYTHONHOME=/opt/gurobi500/linux64
+ export PYTHONPATH=/opt/gurobi500/linux64:
+ PYTHONPATH=/opt/gurobi500/linux64:
+ export PYTHONSTARTUP=/opt/gurobi500/linux64/lib/gurobi.py
+ PYTHONSTARTUP=/opt/gurobi500/linux64/lib/gurobi.py
+ /opt/gurobi500/linux64/bin/python2.7
opt/gurobi500/linux64/bin/gurobi.sh: line 17: /opt/gurobi500/linux64/bin/python2.7: No such file or directory

Doesn't indicate much. All the variables are correctly set.
But it cannot find the file?



Quote:
Originally Posted by Ser Olmy View Post
Run gurobi.sh with "bash -x". It will display each line on the console as it is executed, including the expanded contents of the variables:
bash -x /opt/gurobi500/linux64/bin/gurobi.sh
That should give you an indication as to what the problem might be.
 
Old 05-11-2012, 07:47 PM   #10
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
The error message is pretty clear:

Code:
+ /opt/gurobi500/linux64/bin/python2.7
opt/gurobi500/linux64/bin/gurobi.sh: line 17: /opt/gurobi500/linux64/bin/python2.7: No such file or directory
And yet you say that if you cut and past the path above, /opt/gurobi500/linux64/bin/python2.7, into the command line exactly as-is, it actually starts python?
 
Old 05-11-2012, 07:53 PM   #11
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Realized my mistake. Extremely sorry for my callous nature. I should have noticed the difference.

Its working now. Thank you very much for walking me through it.
Thanks!


Quote:
Originally Posted by Ser Olmy View Post
The error message is pretty clear:

Code:
+ /opt/gurobi500/linux64/bin/python2.7
opt/gurobi500/linux64/bin/gurobi.sh: line 17: /opt/gurobi500/linux64/bin/python2.7: No such file or directory
And yet you say that if you cut and past the path above, /opt/gurobi500/linux64/bin/python2.7, into the command line exactly as-is, it actually starts python?
 
Old 05-11-2012, 07:54 PM   #12
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
No problem. Glad to hear you got it working!
 
Old 06-25-2012, 05:19 PM   #13
Jfgoncal
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
Hi! I have the same problem !!!

But I cannot understand how you solved it.

you say "Realized my mistake." but what was it?

Can you please help me. I am trying to install gurobi and I have no sucess.

Regards

Josť
 
Old 06-25-2012, 06:10 PM   #14
Adwat
LQ Newbie
 
Registered: May 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Hi Jfgoncal,

Rather than /opt/gurobi500/linux64/bin/python2.7 type
opt/gurobi500/linux64/bin/python2.7

i.e the first slash shouldn't be there.
Hope that solves it.

Best,
Adwait
Quote:
Originally Posted by Jfgoncal View Post
Hi! I have the same problem !!!

But I cannot understand how you solved it.

you say "Realized my mistake." but what was it?

Can you please help me. I am trying to install gurobi and I have no sucess.

Regards

Josť
 
Old 06-29-2012, 07:56 PM   #15
Jfgoncal
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
Thank you for your prompt reply.

My problem was different. I did not know i had to run the command "source .bashrc".

Regards

Josť
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Trying to install 'Gmail Backup' but it requires python2.5 - I have python2.8... Robert.Thompson Slackware 6 05-10-2011 09:23 AM
Python2.5-devel is unable to find installed Python2.5 Setya SUSE / openSUSE 1 06-08-2007 02:35 AM
/bin/sh not found Eckstona Linux - Software 3 12-21-2006 01:05 AM
Error when starting up snort: bash:!/bin/sh/usr/local/bin/snort :Eent not found cynthia_thomas Linux - Software 1 11-11-2005 03:59 PM
Vuescan, Nikon Coolscan 5000ED USB Scanner, SuSE Linux64 AMD - trouble with timeout klaus_zinser Linux - Hardware 0 11-15-2004 10:12 AM


All times are GMT -5. The time now is 10:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration