Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ 1 [2] 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: OK so where is the "help me" area?< Next Oldest | Next Newest >
stupid_idiot Offline





Group: Members
Posts: 344
Joined: Oct. 2006
Posted: Mar. 05 2008,14:05 QUOTE

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:
Code Sample
echo $PATH
Or, to list all existing environment variables:
Code Sample
env
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/restore
Quote
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.
Back to top
Profile PM 
stupid_idiot Offline





Group: Members
Posts: 344
Joined: Oct. 2006
Posted: Mar. 06 2008,01:08 QUOTE

Re: Follow-up to above post
Hi Brymway:
Just tested all existing Python 2.5 extensions, namely:
python-2.5.uci
python2.5.uci
python2.5.unc

All of the 3 extensions above already contain a python symlink.

There is no need to manually create any symlinks as I mentioned in my above post. I apologize thoroughly for making you go through all the trouble.

python-2.5.uci comes with /opt/bin/python, which points to /opt/bin/python2.5.

python2.5.uci comes with /usr/bin/python, which points to /opt/py25/bin/python, which is in turn a hard link to /opt/bin/python2.5.
(A hard link is an identical copy of a file, but takes up no disk space - A hard link appears to be an actual file, but it actually references the file contents of the original file.)

python2.5.unc comes with /usr/local/bin/python, which points to /usr/local/bin/python2.5.

Yet if, as you said, the python command does not work, then I surmise that it may have been deleted by accident. Whatever the case, you can restore the python command either by manually creating a symlink, or by reloading the MyDSL extension.

This can be done by doing:
Code Sample
(This will unload the extension:)
mydsl-load [path_to_extension_file]
(And a second time, to reload it:)
mydsl-load [path_to_extension_file]
This does the same thing as using the MyDSL Extension Browser:
Desktop menu -> MyDSL -> MyDSL Extension Browser -> Load Local

p.s.
My apologies, for causing all this confusion.
Back to top
Profile PM 
brymway Offline





Group: Members
Posts: 13
Joined: Mar. 2008
Posted: Mar. 06 2008,03:48 QUOTE

Actually throughout all that, I am starting to understand a little more.   Thanks for your thoroughness.  Now my status.  I click on MyDsl folder on the desktop.  I then click on the mydsl little package icon with the down arrow.  Then I click on unc.  Then I scroll down and click on Python2.5 unc and download it.  Once it downloads, I see three icons in the MyDSL folder on the desktop.  One says Python 2.5.unc, another says python2.5.unc.info and the last says python2.5.unc.md5.txt.  Once it is there, I can open an Xshell and type the word python and the program python is activated inside of the Xshell.  As long as I don't shut down or reboot, it remains like that.  But when I reboot, and come back the next day, Python is gone.  Before I shut down, I click the DSLPanel and then click backup, which, I assume, backs up my bookmarks, desktop backgrounds, and settings.  I can't remember doing anything special other than putting a usb in the slot and addressing 'sda1' when it prompted me to.  I've downloaded desktop themes and backgrounds, and they save automatically but Python never has.  All nine times I've downloaded it.
    So when you say that it comes with a /usr/local/bin/python, I see no proof or as you said, it may be getting deleted by accident.  
    I haven't downloaded Python today since I've started up DSL.  
I can open an Xshell and type in 'cd /usr/bin'.  Then 'ls-a' and don't see anything that remotely says Python.  I type in 'cd /usr/bin/python', no such file.  So I don't think it's saving the program.  I have managed to save Python, it's info and it's txt in /mnt/sda1.  Those three, plus something called mydsl and something called backup.tar.gz.
    So if I understand you right, I need to somehow make a syslink to type, telling the system to activate python inside the XShell I'm in.  But I suppose it would be better if the three python files were in the 'mydsl' file instead.
Back to top
Profile PM 
^thehatsrule^ Offline





Group: Members
Posts: 3275
Joined: July 2006
Posted: Mar. 06 2008,04:37 QUOTE

You'll need to copy the extension from the temporary location to a permanent place, such as on your usb storage.  Then depending on your setup, you may set up auto-loading for your extension(s) or just load them manually.
Back to top
Profile PM 
stupid_idiot Offline





Group: Members
Posts: 344
Joined: Oct. 2006
Posted: Mar. 06 2008,09:41 QUOTE

Re: Backup/restore
brymway:
backup/restore of individual files is different from autoloading of extension files.

Regarding the former, you must edit the text file /home/dsl/.filetool.lst and add files/directories that you want to backup to that text file.

Regarding the latter, you should create a directory named mydsl/ on your backup device (in your case sda1), and then put those extensions that you wish to be autoloaded at startup into that directory.

Since you want python2.5.unc to be loaded at startup, you should do the latter. You do not need to use the Backup/Restore tool at all.

Quote
So if I understand you right, I need to somehow make a syslink to type, telling the system to activate python inside the XShell I'm in.  But I suppose it would be better if the three python files were in the 'mydsl' file instead.
Yes, but you don't need to make any symlink ('symbolic link') - python2.5.unc already provides it. The only thing you need to do is put python2.5.unc in /mnt/sda1/mydsl/.
(The files python2.5.unc.info and python2.5.unc.md5.txt can be discarded at your leisure. The '.info' file is a readme. The '.md5.txt' file is a text file containing the MD5 hash of the actual extension file, i.e. python2.5.unc. It is only used to manually check the extension file for corruption. Other than that, it is not needed at all.
To check whether a file is corrupted:
e.g.
Code Sample
(Generate MD5 hash of 'python2.5.unc' and display it on-screen:)
md5sum python2.5.unc
(Output the contents of 'python2.5.unc.md5.txt' to the screen:)
cat python2.5.unc.md5.txt

If the two strings are the same, your file is clean.
If they are different, your file is corrupted.
Or:
Code Sample
md5sum -c python2.5.unc
('python2.5.unc.md5.txt' must be present.)
Back to top
Profile PM 
12 replies since Mar. 05 2008,02:59 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ 1 [2] 3 >/
reply to topic new topic new poll
Quick Reply: OK so where is the "help me" area?

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code