Posts Tagged “virtualenv”

I’m on Windows and I have created a virtualenv sandbox. I activate the sandbox and now I want to start up an IPython shell using the sandboxed environment. The following will do just that.

python -c "import IPython.Shell; IPython.Shell.IPShell().mainloop(sys_exit=1)"

thx to ThomasWaldmann on #python
Read the rest of this entry »

Comments View Comments

Today 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

Comments View Comments

Powered by Web Design Company Plugins