473,503 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python on a thumbdrive

Hi all

I use a macintosh and a pc at home. On My Mac, I have python
installed. But my Pc hard drive recently failed and I have been
running Damn Small Linux, a derivitave of Knoppix Linux direct from
the cd.

I like Damn small Linux much better than Knoppix, but DSL dosen't have
python. An idea came to me: what if I could load a complete python
distribution for unix onto a jumpdrive (also known as a thumbdrive or
USB drive), those inexpensive flash memory stick drives that plug into
the USB port. then I cold take python with me wherever I went. In
fact, I could have versions for all platforms I was likely to
encounter!

so I bought a 128 meg jumpdrive and copied the python 2.3 directory
from the knoppix disk to the jumpdrive. It copied fine. So I tried
running it. Thats where the problems started.

Becuase there was no linux installation on the jumpdrive, python
looked to the ramdrive where all the usual files would be stored, and
not finding them, gave me the following errors:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Import site failed; use -v for traceback
Python 2.3.3 (#2, May 1 2004, 06:12:12)
[GCC 3.3.3 (debian 20040401)] on Linux 2
Type "help", "copyright", "credits" or "license", for more
information.


Unlike the windows and Mac versions, you have to compile the Linux
version which is why I copied it off of the Knoppix CD. due to my lack
of a hard drive on the PC, I don't have GCC and it's associated files,
and my lack of a swap file makes it impossible to compile from the
Knoppix version of GCC due to only having 64 Megs of memory in the PC.

I tried setting pythonhome from Bash:

PYTHONHOME="/mnt/sda1/python/python2.3"

No dice. Same errors.

Any help achieving my goals of having a transportable python install
on a jumpdrive would be greatly appreciated.

regards,

Mathew
Jul 18 '05 #1
3 1774
TuxTrax wrote:
I tried setting pythonhome from Bash:

PYTHONHOME="/mnt/sda1/python/python2.3"


If you did it like that it's a mistake :

$ PYTHONHOME="/mnt/sda1/python/python2.3"
$ /mnt/sda1/python/python

Do that instead :
$ export PYTHONHOME="/mnt/sda1/python/python2.3"
$ /mnt/sda1/python/python
Jul 18 '05 #2
Christophe Cavalaria <ch*************@free.fr> wrote in message news:<40***********************@news.free.fr>...
TuxTrax wrote:
I tried setting pythonhome from Bash:

PYTHONHOME="/mnt/sda1/python/python2.3"


If you did it like that it's a mistake :

$ PYTHONHOME="/mnt/sda1/python/python2.3"
$ /mnt/sda1/python/python

Do that instead :
$ export PYTHONHOME="/mnt/sda1/python/python2.3"
$ /mnt/sda1/python/python


Thanks, that did the trick except for one remaining error on startup.

I moved the python executable into the python2.3 directory (which is
inside a directory simply called "python"), with the other python
files and directories. I then used the following line in my .bashrc
file:

export PYTHONHOME="/mnt/sda1/python/python2.3"

I don't get the errors on the internal and external component loads
when I start up python now, but I sill get one last error: 'import
site failed'; use -v for traceback

Yet 'site.py' and 'site.pyc' exist in the python2.3 directory. When I
type:
import site


after the initial python import error on starting python up, There are
no errors or complaints from python, and the module seems to have been
loaded in just fine.

Thanks for the help,

Mathew
Jul 18 '05 #3
TuxTrax wrote:
I have been running Damn Small Linux, a derivitave of Knoppix Linux direct from
the cd.

Rather OT, but why don't you customize the DSL iso? It's a
Knoppix/Debian derative after all, so that shouldn't be too difficult.

http://www.linuxdevcenter.com/pub/a/...0/knoppix.html
http://www.knoppix.net/docs/index.ph...masteringHowto

Regards,

Iwan
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2372
by: Emile van Sebille | last post by:
QOTW: "If we get 2.3.3c1 out in early December, we could release 2.3.3 final before the end of the year, and start 2004 with a 100% bug-free codebase <wink>." -- Tim Peters "cjOr proWe vbCould...
0
1873
by: Emile van Sebille | last post by:
QOTW: "Have you ever used the copy module? I am *not* a beginner, and have used it *once* (and I can't remember what for, either)." -- Michael Hudson "It will likely take a little practice...
0
2206
by: Emile van Sebille | last post by:
QOTW (in the OS agnostic category): "There is a (very popular) Python package out there which exposes the win32 api. I'm not sure what it's called. (win32api? pythonwin? win32all?)" -- Francis...
0
1544
by: Emile van Sebille | last post by:
QOTW (advanced interfaces track): "I'm firmly in favour of any language that can DWIMNWIS." -- Tim Delaney QOTW (MS roadkill track): "Underestimate MS at your own risk. It is one thing to not...
0
7192
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
369
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.