stupid_idiot
Group: Members
Posts: 344
Joined: Oct. 2006 |
|
Posted: Mar. 05 2008,14:05 |
|
brymway: There are 3 different Python-2.5 extensions in MyDSL: system/python2.5.unc testing/python-2.5.uci testing/python2.5.uci I realize you must be using python2.5.unc. I made the stupid assumption that you were using python-2.5.uci. Therefore, please disregard everything I posted before. I am very sorry for wasting your time completely.
python2.5.unc was configured with '/usr/local' as the top-level directory. The Python executable is in 'bin/', under '/usr/local/' - i.e. '/usr/local/bin/python2.5', as you said.
The other extensions testing/python-2.5.uci and testing/python2.5.uci were configured to use the top-level directories '/opt/python-2.5' and '/opt/python2.5' respectively. Hence, the weird locations and instructions in my previous post.
Some essential background information: The shell runs commands you type by looking for files with the same name in a list of system directories. This list is found in the environment variable $PATH. (The "$" symbol that comes before a word is used to refer to an environment variable.) $PATH is a list of directories appended one after another, delimited with parentheses - ":". You can see what is in $PATH by running:Or, to list all existing environment variables:In our case, a file named python must exist in any of the directories in $PATH for the typed command "python" to work. Normally, /usr/local/bin/python exists as a symbolic link (a.k.a. symlink) to /usr/local/bin/python2.5. If /usr/local/bin/python exists, the command "python" would work - because '/usr/local/bin' is in the shell's default $PATH. If "python" does not work, we can assume that /usr/local/bin/python is missing.
The standard way to fix this is to create a symlink named python, that links/points to the actual Python executable file - in our case, /usr/local/bin/python2.5. To do that:Code Sample | ln -s python2.5 /usr/local/bin/python | Or:Code Sample | cd /usr/local/bin ln -s python2.5 python | After doing so, Python should run when you type in "python". (Of course, we could also copy the actual file, /usr/local/bin/python-2.5 to /usr/local/bin/python. This would also work, but is a waste of disk space. Creating a symbolic link serves the same purpose while conserving disk space.)
Re: Backup/restoreQuote | How do I get it into a file like the /opt/filetool.lst so that it is there when I type "python" in the terminal window? | Do you mean that you want Python to be loaded and ready for use whenever you boot DSL? If so, please do the following: 1. Create a directory on your pendrive called mydsl:Code Sample | mkdir /mnt/sda1/mydsl | Then, place 'python2.5.unc' (the file that you downloaded from MyDSL) inside '/mnt/sda1/mydsl/'. On booting DSL, all extensions found in this folder will be automatically loaded. 2. However, since your attempt to run "python" failed, I guess python2.5.unc does not come with the file /usr/local/bin/python. This could have been an oversight on the part of whomever made the extension. To make the "python" command work immediately on boot-up, the file /usr/local/bin/python needs to be created everytime DSL boots. Note: python2.5.unc DOES come with /usr/local/bin/python. There is NO NEED to backup this file!! Repeat: There is NO NEED to backup this file!! Please see the next post. One way to do this, would be to first create /usr/local/bin/python as shown a few paragraphs above, and then save it into DSL's backup file (named user.tar.gz - can be saved in any drive partition, e.g. pendrive). To do so, you would first need to edit the textfile /home/dsl/.filetool.lst, and add in /usr/local/bin/python. Then, run DSL's Backup/Restore tool (from the desktop menu); enter a device name (e.g. sda1 - your pendrive), and then click Backup. A backup file named user.tar.gz will be created in /mnt/sda1/. (DSL will also automatically make such a backup file during shutdown/reboot. Do note that if you haven't specified which device - e.g. sda1 - to use for backup, DSL will abort the shutdown and ask that you specify a device.) Or, you can choose not to backup - just manually create the symlink /usr/local/bin/python everytime you boot DSL. Note: python2.5.unc DOES come with /usr/local/bin/python. There is NO NEED to backup this file!! Repeat: There is NO NEED to backup this file!! Please see the next post.
Hope this helps, and please feel free to ask if you are unsure about anything.
|