Install a Python extension to a virtualenv sandbox that is packaged as a Windows binary installer
Posted by Chaim in Uncategorized, tags: binary, installer, python, virtualenv, windowsToday I wanted to install the Python Cryptography Toolkit into a sandbox I had created using virtualenv. The issue was that the PCT was available as a Windows binary at The Voidspace Python Modules but I didn’t know how to install it to a sandbox because the EXE installer looks to the registry for the location of the system installation of Python.
After a little searching and experimenting I realized that all you need to do is to change the location the registry is point to from the system installation of Python to the sandboxed version.
So in my case I backed up the current registry key.
REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath] @="C:\\Python26\\"
And then created a copy of the file and modified it to point to the sandboxed Python install.
REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.6\InstallPath] @="D:\\workspace\\mysandbox\\"
At this point you simply run the EXE installer and it will be installed to the sandbox. After it is installed, restore the original registry key.
update:
I am running 64-bit Windows 7 on one of my computers and see that the corresponding registry entry is at:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.6\InstallPath
Entries (RSS)