Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Python 2.6 without using installer on Win32

I need to run a Python script on a machine that doesn't have Python installed. I use Python as a part of a software package, and Python runs behind the curtain without the user's notice of it.

What I did was as follows.

  1. Copy python.exe, python26.dll, msvcr90.dll and Microsoft.VC90.CRT.manifest
  2. Zip all the directory in LIBs directory as the python26.zip
  3. Copy all the necessary dll/pyd files inside the DLL directory.

It seems to work, but when I change the python26.zip to the other name such as pythonlib.zip, it cannot find the Python library any more.

  • Question 1: What's the magic behind the python26.zip name? Python automatically finds a library inside a python26.zip, but not with different name?
  • Question 2: If I have python26.zip at the same directory where python.exe/python26.dll is, I don't need to add path sys.path.append (THE PATH TO python26.zip). Is it correct?

Python has built-in libraries, and sys is one of them. I thought that I could use sys.path to point to whatever Python library in the ZIP file I needed. But, surprisingly, if I use the library name as Python26.zip, it just worked. Why is this so?

like image 364
prosseek Avatar asked Apr 20 '10 21:04

prosseek


1 Answers

I have been using PortablePython for a year now, and I find it great as it is working on my locked-down work-notebook.

There is a Python 2.5.4, 2.6.1 and a 3.0.1 version.

like image 186
das_weezul Avatar answered Oct 08 '22 18:10

das_weezul