LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 12-03-2004, 06:42 PM   #1
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Rep: Reputation: 30
python doesn´t work


I have slackware 10, I delete python 2.3.4 and download the latest python 2.4 from python.org I compile it, and install it in /opt/python I make symlink of python and python2.4 like this:

/opt/python/bin
ln -s python /usr/bin
ln -s python2.4 /usr/bin

Now when I try to execute it in the konsole I get a command not found. the only way I could execute python without problem is this way, cd to the dir where python is and execute it.

cd /opt/python/bin
./python

And I want it to run without I login to python DIR. it supposed to be in /usr/bin so why I get a command not found answer.
 
Old 12-03-2004, 07:29 PM   #2
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
You appear to have installed in /opt instead of /usr. The simplest fix is to add /opt/python/bin to your path. Most likely by editing ~/.bash_profile (.bash_profile in your user's home dir, for root in /root)
 
Old 12-03-2004, 09:31 PM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
Re: python doesn´t work

Quote:
Originally posted by little_ball

/opt/python/bin
ln -s python /usr/bin
ln -s python2.4 /usr/bin

these command don't make good links

you just get broken links in /usr/bin
python -> python

i think like kevinalm better to just update PATH variable to include /opt/python/bin
links take system resources and are confusing

but to make the links use full path and name to be clear
ln -s /opt/python/bin/python /usr/bin/python
 
Old 12-03-2004, 10:14 PM   #4
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
Iirc, those ln commands will create the desired links as long as they are executed from within /opt/python/bin. Ln has some syntax quirks that are not exactly intuitive, although they make sense if you think about it. man ln But I beleive you also need to have the dir containing the executables linked to in your path anyway, security thing. I think your user also needs execute perm in both directories.

Personally, I do prefer the full ln -s /path/to/target /path/to/linkname. Less chance for confusion.

Last edited by kevinalm; 12-03-2004 at 10:22 PM.
 
Old 12-04-2004, 09:09 AM   #5
little_ball
Member
 
Registered: Oct 2003
Location: teddy bears Land
Distribution: Slackware 10
Posts: 176

Original Poster
Rep: Reputation: 30
Thanks. I didn´t know that making it this way:

cd /opt/python/bin
ln -s python /usr/bin/python

make broken symlinks. it work out this way very well:

ln -s /opt/python/bin/python /usr/bin/python

Well I guess I have to learn a lot about Linux.
 
  


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
vnc4server doesn`t work! tyranus Debian 4 06-02-2006 06:08 PM
sshd doesn`t work TiCkO Linux - Networking 12 02-11-2006 05:00 PM
Wi-Fi doesn;t work on Suse 9.3 hackerarchangel Linux - Hardware 2 10-18-2005 12:59 PM
PS/2 mouse doesn´t work :( teekaay Slackware 7 01-08-2004 02:22 AM
kopete doesn´t work maZ Linux - Software 1 07-31-2003 03:51 PM


All times are GMT -5. The time now is 02:37 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration