= Making a Python 2.7 package for OSGeo4W = Some rough notes for how [wiki:MattWilkie I] built a python 2.7 package. Open a command shell and {{{ set osgeo4w_root=c:\o4w_py27 apt.exe setup :: to share cache with existing install :: and avoid needless downloads copy c:\osgeo4w\etc\setup\last-cache %osgeo4w_root%\etc\setup\ :: install py25, then examine folder structure apt install python :: install py27 from standard msi installer (outside o4w) start d:\dee\Downloads\Programming\python-2.7.1.msi :: Manually compare c:\python27 to c:\o4w_py27\ :: then reflect the structure xcopy /s c:\python27 C:\o4w_py27\apps\Python27 pushd %osgeo4w_root% move apps\Python27\*.exe bin\ if exist %windir%\SysWOW64\python27.dll copy %windir%\SysWOW64\python27.dll bin\ if exist %windir%\System32\python27.dll copy %windir%\System32\python27.dll bin\ :: overwrite python shell batch file :: (must be run from within bat file or the %% don't collapse properly to single %) SET PYTHONHOME=%%OSGEO4W_ROOT%%\apps\Python27> etc\ini\python.bat :: now create the package archive 7z a -ttar python-2.7.1-1.tar apps\Python27 bin\python*.exe bin\w9xpopen.exe bin\python27.dll etc\ini\python.bat 7z a -tbzip2 -mx9 -mmt=on python-2.7.1-1.tar.bz2 python-2.7.1-1.tar }}}