This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Henning.von.Bargen
Recipients Andreas.Richter, Henning.von.Bargen, loewis, terry.reedy, zach.ware
Date 2016-12-19.07:59:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482134349.52.0.843093621011.issue22139@psf.upfronthosting.co.za>
In-reply-to
Content
A belated update... What I'm trying is similar to virtualenv:

My application should not depend on any pre-installed Python and not have any influence on it (and it should not modify the registry or the system environment variables).

It should be noted that my application is using a different executable instead of python.exe.

On Linux, I can do "make altinstall", but on Windows, setting up everything for compiling Python is out of scope.

Some of my other programs are using Python 3.5. With its "embeddable zip" it is very easy to achieve this goal.

Unfortunately, the most important program is using Python 2 on Windows and re-writing it for Python 3 would be quite an effort.

I think I finally found a way now with Python 2.7:

1. Define a directory where Python 2.x should be installed.
   SET PYTHONHOME=....
2. Create that directory
   MKDIR %PYTHONHOME%
3. Run the installer like this:
   msiexec /a python-2.7.12.amd64 /qb TARGETDIR=%PYTHONHOME%
4. Useful: pushd %PYTHONHOME%; python -m ensurepip; popd
5. Copy python 27.dll next to your executable (see http://blog.pyspoken.com/2016/04/27/embedding-python-how-to-confuse-python-and-yourself) - this is the important step.
   copy /b %PYTHONHOME%\python27.dll %MY_APPLICATION_HOME%\bin\
6. When running your executable, use a script which sets %PYTHONHOME%
   copy /b %PYTHONHOME%\
History
Date User Action Args
2016-12-19 07:59:09Henning.von.Bargensetrecipients: + Henning.von.Bargen, loewis, terry.reedy, zach.ware, Andreas.Richter
2016-12-19 07:59:09Henning.von.Bargensetmessageid: <1482134349.52.0.843093621011.issue22139@psf.upfronthosting.co.za>
2016-12-19 07:59:09Henning.von.Bargenlinkissue22139 messages
2016-12-19 07:59:08Henning.von.Bargencreate