Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 956413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T00:32:05+00:00 2026-05-16T00:32:05+00:00

Virtualenv is great: it lets me keep a number of distinct Python installations so

  • 0

Virtualenv is great: it lets me keep a number of distinct Python installations so that different projects’ dependencies aren’t all thrown together into a common pile.

But if I want to install a package on Windows that’s packaged as a .exe installer, how can I direct it to install into the virtualenv? For example, I have pycuda-0.94rc.win32-py2.6.exe. When I run it, it examines the registry, and finds only one Python26 to install into, the common one that my virtualenv is based off of.

How can I direct it to install into the virtualenv?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T00:32:05+00:00Added an answer on May 16, 2026 at 12:32 am

    I ended up adapting a script (http://effbot.org/zone/python-register.htm) to register a Python installation in the registry. I can pick the Python to be the Python in the registry, run the Windows installer, then set the registry back:

    # -*- encoding: utf-8 -*-
    #
    # script to register Python 2.0 or later for use with win32all
    # and other extensions that require Python registry settings
    #
    # Adapted by Ned Batchelder from a script
    # written by Joakim Löw for Secret Labs AB / PythonWare
    #
    # source:
    # http://www.pythonware.com/products/works/articles/regpy20.htm
    
    import sys
    
    from _winreg import *
    
    # tweak as necessary
    version = sys.version[:3]
    installpath = sys.prefix
    
    regpath = "SOFTWARE\\Python\\Pythoncore\\%s\\" % (version)
    installkey = "InstallPath"
    pythonkey = "PythonPath"
    pythonpath = "%s;%s\\Lib\\;%s\\DLLs\\" % (
        installpath, installpath, installpath
    )
    
    def RegisterPy():
        try:
            reg = OpenKey(HKEY_LOCAL_MACHINE, regpath)
        except EnvironmentError:
            try:
                reg = CreateKey(HKEY_LOCAL_MACHINE, regpath)
            except Exception, e:
                print "*** Unable to register: %s" % e
                return
    
        SetValue(reg, installkey, REG_SZ, installpath)
        SetValue(reg, pythonkey, REG_SZ, pythonpath)
        CloseKey(reg)
        print "--- Python %s at %s is now registered!" % (version, installpath)
    
    if __name__ == "__main__":
        RegisterPy()
    

    Run this script with the Python you want to be registered, and it will be entered into the registry. Note that on Windows 7 and Vista, you’ll need Administrator privileges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a virtualenv in my django app folder, and there I installed all
Seems everyone recommends virtualenv for multiple python versions (on osx), but does it even
I've been using virtualenv lately while developing in python. I like the idea of
I'm using virtualenv-1.4.5 on Mac OS X 10.6.2 (Xcode is installed) and Python 2.6.
I'm quite fond of Python's virtualenv , which facilitates maintenance of separate Python configurations.
I'm writing a Django application that is using pip & virtualenv to manage its
Setting up a virtualenv for the first time, when i try to install MySQL-python
when I try to create a virtualenv that uses python2.5 I get the following
I'm starting to use virtualenv and virtualenvwrapper on my projects. After activating the virtualenv
When I create a fresh virtualenv, pip freeze shows that I have a couple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.