Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem installing pywin32

Tags:

python

pywin32

I am trying to install pywin32 for Python 2.6. I have python installed but it's not in the regular c: drive but on the d: drive . The pywin32 installer does not find it and I cannot give the custom path to it.

I checked, thepython folder is the path. Is there a workaround this issue ?

like image 794
Johanna Avatar asked Jul 12 '11 10:07

Johanna


People also ask

Does pywin32 work on 64 bit Python?

Some packages have a 32bit and a 64bit version available - you must download the one which corresponds to the Python you have installed. Even if you have a 64bit computer, if you installed a 32bit version of Python you must install the 32bit version of pywin32.

Can you install pywin32 on Mac?

pywin32 wraps the Windows API libraries. Mac OS X is not Windows; it does not implement the Windows API. Thus, there is nothing for pywin32 to wrap on a Mac.

Is pywin32 available in Linux?

You can't install pywin32 on Kali Linux because it's only available for Windows. It provides access to the Win32 APIs and to COM objects, and a Python program intended to work on any Linux distribution shouldn't need those (or it should only attempt to use them conditionally).


1 Answers

Update 2017-06-14 Seems like with python 3.6 the same problem re-apeared. But I found a nice suggestion: There is a pip version of pywin32: Just use

pip install pypiwin32

It did not install the latest version (sourceforge has 221 at the moment, it installed 220), but it worked without registry modifications or any other hacks.

Update 2017-02-01: I just tried the installation of build 220 using Python 3.5.2 32 bit on Windows 10 (64 bit), and everything worked nicely without and need to modify the registry. So the best advice might be to use the most recent build instead of build 219.

Old solution (build 219):

I ran into the same issue today when I tried to install pywin32 together with Python 3.5 win32 under Windows 8.1.

All installers (build 219) for py 3.5 failed, and modifying the registry as described in the posts of Jesus Flores and lauren alsina did not solve the problem.

What did the trick for me was to add the registry entrys not in HKEY_LOCAL_MACHINE but in HKEY_CURRENT_USER and change the python version in PythonCorefrom 3.5-32 to 3.5.

Interestingly enough, with the 3.5-32 key, the 64 bit installer works, but of course you will run into problems because the 64 bit libs installed are not compatible with the 32 bit python. Something is very broken in this installer.

So in summary, my working .reg file for Python 3.5 w32 looks like this:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Python]

[HKEY_CURRENT_USER\SOFTWARE\Python\PyLauncher]
"InstallDir"="C:\\Windows\\"
"AssociateFiles"=dword:00000001
@="C:\\Windows\\py.exe"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\Help]

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\Help\Main Python Documentation]
@="C:\\Program Files (x86)\\Python 3.5\\Doc\\python350.chm"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\Idle]
@="C:\\Program Files (x86)\\Python 3.5\\Lib\\idlelib\\idle.pyw"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\IdleShortcuts]
@=dword:00000001

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\InstalledFeatures]
"dev"="3.5.150.0"
"Shortcuts"="3.5.150.0"
"exe"="3.5.150.0"
"lib"="3.5.150.0"
"test"="3.5.150.0"
"doc_shortcut"="3.5.150.0"
"doc"="3.5.150.0"
"tools"="3.5.150.0"
"tcltk"="3.5.150.0"
"pip"="3.5.150.0"
"path"="3.5.150.0"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\InstallPath]
@="C:\\Program Files (x86)\\Python 3.5\\"
"ExecutablePath"="C:\\Program Files (x86)\\Python 3.5\\python.exe"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\InstallPath\InstallGroup]
@="Python 3.5"

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.5\PythonPath]
@="C:\\Program Files (x86)\\Python 3.5\\Lib\\;C:\\Program Files (x86)\\Python 3.5\\DLLs\\"
like image 133
OBu Avatar answered Nov 13 '22 12:11

OBu