2010-01-13

64 bit python installation issues on 64 bit Windows 7

After installing 64 bit Windows 7 at work, I got a problem of installing many python utilities that search for installed python locations is windows registry. distutils (setuptools-0.6c11.win32-py2.6.exe) still could not find 64 bit python installation, as well as develer's Unofficial MinGW GCC binaries for Windows (I still do not have a solution for that one :( ).

Actually, what helped me with disttools, was a http://www.mail-archive.com/distutils-sig@python.org/msg10512.html group thread. The currently available 64 bit python installation is registering python in a new location in windows registry. So one have to use a modified script for registering python the old way:

#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html

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_CURRENT_USER, regpath)
    except EnvironmentError as e:
        try:
            reg = CreateKey(HKEY_CURRENT_USER, regpath)
            SetValue(reg, installkey, REG_SZ, installpath)
            SetValue(reg, pythonkey, REG_SZ, pythonpath)
            CloseKey(reg)
        except:
            print "*** Unable to register!"
            return
        print "--- Python", version, "is now registered!"
        return
    if (QueryValue(reg, installkey) == installpath and
        QueryValue(reg, pythonkey) == pythonpath):
        CloseKey(reg)
        print "=== Python", version, "is already registered!"
        return
    CloseKey(reg)
    print "*** Unable to register!"
    print "*** You probably have another Python installation!"

if __name__ == "__main__":
    RegisterPy()

or just inject the following REG file into your registry if you are using python 2.6 installed in C:\Python26 directory

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Python]

[HKEY_CURRENT_USER\Software\Python\Pythoncore]

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6]

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6\InstallPath]
@="C:\\Python26"

[HKEY_CURRENT_USER\Software\Python\Pythoncore\2.6\PythonPath]
@="C:\\Python26;C:\\Python26\\Lib\\;C:\\Python26\\DLLs\\"

82 comments:

  1. was having some problems installing psycopg for postgres/postgis. used the registry contents that you posted above and it appears this saved me from having to reinstall python as 32-bit on my 64-bit windows 7 machine. thanks for the post!

    ReplyDelete
  2. It worked for me too (installing PIL). Thank you so much.

    ReplyDelete
  3. Added those lines to a txt file then changed to a .reg file and merged to the registry and it worked for me too!

    ReplyDelete
  4. The problem is the pywin32 is a 32 bit installer, it will look for the Python reg entries in the Wow6432Node, the following .reg file will add the entries, ensure the paths are correct for your install.

    Tested with Windows 7 x64 and python 3.2.


    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\Help]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\Help\Main Python Documentation]
    @="C:\\Python32\\Doc\\python32.chm"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\InstallPath]
    @="C:\\Python32\\"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\InstallPath\InstallGroup]
    @="Python 3.2"

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\Modules]

    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.2\PythonPath]
    @="C:\\Python32\\Lib;C:\\Python32\\DLLs"

    ReplyDelete
  5. thanks a lot! it worked
    (had a problem with pysqlite for python27)

    ReplyDelete
  6. Thank you, worked like a charm, installed pywin32

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. I used RegEdt32 and went into the HKEY_LOCAL_MACHINE hive, selected the python key, and used the export command to create a file I called pyreg.reg. This made a file similar to the one shown in the comment. I then replaced all references to HKEY_LOCAL_MACHINE with HKEY_CURRENT_USER (in NotePad), and saved the result as pyreg1.reg. I then executed on the cmd line:

    regedt32 pyreg1.reg

    (The effect of doing this is to capture the exact version of Python you have installed, including any changes to the registry layout it has).

    ReplyDelete
  9. Thank you! that worked for me!

    ReplyDelete
  10. Thank you very much! (Problem with Mabot installation has been fixed.)

    ReplyDelete
  11. Used the .reg method, worked like a charm for Python27.

    Thanks a lot!

    ReplyDelete
  12. thx man i got so many solution , but just your are perfect
    thx a lot

    ReplyDelete
  13. Thanks for this page on what to fill in for registry. It was strange though that 2.6 and 2.7 registered properly and 3.3 did not. I'm not sure if python is like Visual Studio where you have to have them in the proper order but I tried my best to do that.

    ReplyDelete
  14. Thank you may you live forever and continue the work forever.

    ReplyDelete
  15. Prevented me from having to do this manually; thus, very useful, and much appreciated.

    ReplyDelete
  16. Thank you very much for the post. Helped a lot.

    ReplyDelete
  17. The solution is working on my PC. I also have windows 7 and suffers the same problem with it.

    Alvin
    www.ddlforall.blogspot.com

    ReplyDelete
  18. Thank you, it worked for solving "unable register" problem when installing psycopg for postgres.

    ReplyDelete
  19. It is Very Helpfull. I like it so much, Thanksss a lot.

    free crack software | photo mechanic 5 serial

    ReplyDelete
  20. Amazing thanks for posting such a great tutorial its really very helpful for Php developer's in installing Python.Click here to download more Free Crack Software's == >
    Latest Crack Software | Download Crack Software | Free Crack Software
    Free Download Software | New Software Download

    ReplyDelete
  21. Download Full Crack click the following;
    https://cracklayer.com/falcon-box/
    https://cracklayer.com/z3x-lg-tool/
    https://cracklayer.com/norton-security/

    ReplyDelete
  22. Wonderful work! This is the kind of info that is meant to be shared across the internet. Disgrace on the search engines for not positioning this post higher! Come on over and consult with my website.
    So, I would like to Share VideoSolo Screen Recorder Crack with you.
    Windows 7 Ultimate ISO

    ReplyDelete
  23. I really appreciate your initiative and your blog approach it helps many people like myself.

    do visit my site for new and updated software : VovSoft VCF to TXT Converter

    ReplyDelete
  24. Really Good Work Done By You...However, stopping by with great quality writing, it's hard to see any good blog today.
    4K Stogram 3.4.3.3630 Crack

    ReplyDelete
  25. Nice explanation and article. Continue to write articles like these, and visit my website at https://usacrack.info/ for more information.

    StudioLine Web Designer 4.2.66 Crack

    ReplyDelete
  26. Your style is so unique compared to other people I have read stuff from. Many thanks forposting when you have the opportunity, Guess I will just bookmark this site 4K Stogram

    ReplyDelete
  27. This is amzaing blog thanks for that great information. Thanks!
    adobe-dreamweaver-crack

    combin-crack/

    vray-crack

    ReplyDelete


  28. You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read.
    crackrepack.com/

    ReplyDelete
  29. Nice explanation and article. Continue to write articles like these, and visit my website at https://usacrack.info/ for more information.
    Enscape3D Sketchup Crack
    Quillbot Premium Crack
    EasyWorship Crack
    EaseUS MobiSaver Crack
    Teorex Inpaint 9.1 Crack

    ReplyDelete

  30. So nice I am enjoying for that post as for u latest version of this Security tool Available
    Lumion Pro Crack
    Debut Video Capture Crack
    iExplorer Crack
    Nitro Pro Crack
    PhpStorm Crack

    ReplyDelete
  31. Good work with the hard work you have done I appreciate your work thanks for sharing it...
    Debut Video Capture Pro Crack

    ReplyDelete

  32. Nice explanation and article. Continue to write articles like these, and visit my website at https://usacrack.info/ for more information.
    Teorex Inpaint 9.1 Crack
    Enscape3D Sketchup Crack
    Quillbot Premium Crack
    EasyWorship Crack
    EaseUS MobiSaver Crack

    ReplyDelete
  33. I read this article! I hope you will continue to have such articles to share with everyone! thank you! You can Visit my website
    https://icracker.net/https://icracker.net/
    iexplorer-crack
    corel-draw-crack

    ReplyDelete
  34. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Crack But Thankfully, I recently visited a website named Cracked Fine
    Photo Mechanic Crack

    ReplyDelete
  35. Filmora Scrn Crack

    GBWhatsApp Apk Crack

    MAirList Home Studio Crack

    AVS Video Editor Crack

    Acronis True Image Crack


    Thanks you for sharing. This is Very Usefull. These are brand new software!!! I'm very impress with you. Keep It Up!!!

    ReplyDelete

  36. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to post But thankfully, I recently visited a website named Crack Softwares Free Download
    Download Crack Softwares Free Download
    Windows 11 Activator Crack
    Nitro Pro Crack
    Adobe Acrobat Pro DC Crack
    Proteus Crack
    Restoro Crack
    NoteBurner Spotify Music Converter Crack
    VueMinder Ultimate Crack

    ReplyDelete
  37. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. prosvst.com I hope to have many more entries or so from you.
    Very interesting blog.
    Bandicut Crack

    ReplyDelete


  38. I'm really impressed with your writing skills, as smart as the structure of your weblog.
    Is this a paid topic or do you change it yourself?
    However, stopping by with great quality writing, it's hard to see any good blog today
    crackkeywin.com
    DRAWBOARD PDF Crack
    TRANSMUTER STUDIO Crack
    FREEMAKE VIDEO DOWNLOADER Crack
    SHARP WORLD CLOCK Crack

    ReplyDelete

  39. I guess I am the only one who came here to share my very own experience. Guess what!? I am using my laptop for almost the past 2 years, but I had no idea of solving some basic issues. I do not know how to Download Latest PC Cracked Softwares But thankfully, I recently visited a website named pcsoftz.net
    Adobe Photoshop Lightroom Crack
    Icecream PDF Editor Pro crack
    Tenorshare 4uKey For Android Crack
    Restoro Crack
    Restoro Crack
    Autodesk PowerMill Crack
    NoteBurner Spotify Music Converter Crack
    Nitro Pro Crack

    ReplyDelete
  40. Philippe Ribiere -Rock Climber: Zivali Website >>>>> Download Now

    >>>>> Download Full

    Philippe Ribiere -Rock Climber: Zivali Website >>>>> Download LINK

    >>>>> Download Now

    Philippe Ribiere -Rock Climber: Zivali Website >>>>> Download Full

    >>>>> Download LINK II

    ReplyDelete
  41. Acronis disk director Crack offers professional-grade partitioning tools, as well as a set of user-friendly controls, to make any operation quick and easy

    ReplyDelete
  42. Vectric Aspire Crack Free Download provides a powerful and intuitive software solution for creating and cutting spare parts with CNC routers.

    ReplyDelete
  43. Vectric Aspire Crack Free Download provides a powerful and intuitive software solution for creating and cutting spare parts with CNC routers.
    Arturia Pigments VST Crack
    USB Network Gate Crack
    HitFilm Pro Crack
    Posterino Crack
    Clip Studio Paint EX Crack

    ReplyDelete

  44. Wow, amazing block structure! How long
    Have you written a blog before? Working on a blog seems easy.
    The overview of your website is pretty good, not to mention what it does.
    In the content!
    vstkey.com
    PUSH Video Wallpaper Crack
    FL Studio Crack
    LD Player Crack
    Enscape 3D Crack
    IDM Crack
    PhpStorm Crack
    Redshift Render Crack

    ReplyDelete

  45. I like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
    Very interesting blog.
    vstdownloader.com
    EaseUS Todo PCTrans Crack

    ReplyDelete
  46. It was not first article by this author as I always found him as a talented author. Super Bowl Dr. Dre Jacket

    ReplyDelete
  47. Vavaview IPTV Vavaview IPTV over 19000 live channels,
    more than 65000 movies and 9000 plus series which contains over 300000 episodes, all in stunning HD, UHD and 4K video ...https://vavaviewiptv.com/

    ReplyDelete
  48. I recently ran a Telstra speed test on my home internet connection and was pleasantly surprised with the results. My download speeds were consistently above 80 Mbps and my upload speeds were hovering around 20 Mbps. This was a significant improvement from my previous internet provider, where I was often experiencing slowdowns and intermittent connection issues.

    ReplyDelete
  49. Kemo IPTV is one of the popular IPTV services and is the best alternative to traditional cable TV services. It allows you to stream videos at high-resolution quality. This IPTV offers live TV channels, movies, TV shows, sports, news, PPV, and many more. It is accessible on different devices such as Android, Firestick, iOS, and more. This IPTV offers fast and stable servers with Antifreeze technology.

    ReplyDelete
  50. hy, nice blog .keep it up
    Download latest version Matlab R2023a Crack

    ReplyDelete
  51. My time expanded web search has now been seen with reasonable tips to provide for my accomplices and partners. Winter Sale Jackets

    ReplyDelete
  52. In 2024, the tamilrockers proxy sites list and unblocked new link persist as a torrent website, serving as a proxy for users to download the latest movies, music, videos, and shows, including notable titles like "Salaar," "Dunki," and "12th Fail." Functioning as a gateway, it enables users to explore and acquire copyrighted content through magnet links and torrent files, fostering peer-to-peer file distribution.

    ReplyDelete
  53. In 2024, the tamilrockers proxy site sites list and unblocked new link persist as a torrent website, serving as a proxy for users to download the latest movies, music, videos, and shows, including notable titles like "Salaar," "Dunki," and "12th Fail." Functioning as a gateway, it enables users to explore and acquire copyrighted content through magnet links and torrent files, fostering peer-to-peer file distribution.

    ReplyDelete
  54. The Basic Stussy Hoodie on Arsenaljackets.com offers a classic, street-ready design for everyday wear. Made with soft, durable fabric, it ensures comfort and style in one. Perfect for layering or wearing solo, this hoodie is a must-have in your collection.






    ReplyDelete
  55. The Peaky Blinders Tuxedo is a masterclass in vintage elegance and 1920s sophistication. 🧥💼 Crafted from sturdy tweed—often in herringbone or houndstooth—it achieves a muted yet textured palate perfect for the gritty backstreet world of Birmingham’s criminal underbelly

    . Chaacterized by high-waisted trousers, a fitted waistcoat, and two-button jackets with wide notch lapels, it exudes both authority and understated menace

    ReplyDelete
  56. The Warriors Vest is iconic in every sense—tough, gritty, and charged with the chaotic energy of 1970s NYC nightlife. With its sleeveless cut, bold red-and-black “Warriors” lettering, and the skull-wing back patch, it’s a visual punch that screams street power. It’s not just screenwear—it embodies the loyalty, rebellion, and tribal identity at the heart of the film. Whether you’re a die-hard cult cinema fan, a streetwear aficionado, or just love edgy vintage style, this vest hits every note: raw, rebellious, and truly unforgettable. “Come out to play” indeed.

    ReplyDelete