473,569 Members | 2,836 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 1775
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
2375
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 vbSettle prpFor noEnglish prpIn adjHungarian noNotation :-)" -- noPeter Jack Jensen reveals that python on mac continues as an osx option only...
0
1878
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 before this stuff rattles off your fingertips easily." -- Paul Rubin BJ MacNevin wants to run python from a CD....
0
2214
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 Avila QOTW (in the popular vote category): "So far, python has been the easiest language to learn I've ever come across. I tried learning perl,...
0
1553
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 like MS, and possibly a reasonable position to take. However, underestimating them is for fools." -- Mark Hammond, on Microsoft's commitment to...
0
7695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8119
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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 we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.