Select to view content in your preferred language

Trouble installing Pythonwin in Pro 3.3.1

355
3
Jump to solution
08-27-2024 09:27 AM
ChrisSnyder
Honored Contributor

A longshot that anyone else is still using the Pythonwin IDE, but... Has anyone had issues installing Pythonwin in Pro v3.3.1? I've been merrily installing/using Pythonwin for 15 years to the base ESRI python install up until yesterday when I upgraded from Pro 3.2.1 to v3.3.1. I have always used the .exe Pythonwin installers - this time using pywin32-306.win-amd64-py3.11.exe  from https://github.com/mhammond/pywin32/releases.

Starting with ArcGIS Pro, I've been able to hack the PythonWin installer to "find" the ESRI-installed python.exe using this .reg file <edited for Python version of course>:

Windows Registry Editor Version 5.00
Note: So that PythonWin can function still with ArcGIS Pro arcpy... may needed to be edited if > v3.11

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11]

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\Help]
@=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\Help\Pythonwin Reference]
@="C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\Lib\\site-packages\\PyWin32.chm"

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\InstallPath]
@="C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3"

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

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\Modules]

[HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\3.11\PythonPath]
@="C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\Lib;C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\DLLs;C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\Lib\\lib-tk"

Pythonwin seems to install correctly but upon startup it throws an error: "The application can not locate Python39.dll (126). The specified module could not be found."

...and yes, I am using the 3.11 Pythonwin installer, so not sure why it is looking for Python39.dll?!?

Anyone successfully get Pythonwin working with Pro v3.3.1? If so, any tricks to go about it?

BTW: This may be actually a good thing.... and actually force me to use a modern Python IDE 😉

 

 

 

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ChrisSnyder
Honored Contributor

After much struggle - PythonWin lives at ArcGIS Pro v3.3.1!

For future reference, the PythonWin.exe installer no longer works for Pro 3.3.1 – at least in Pro’s anaconda environment - and you seemly have to install via command prompt.

After installing Pro 3.3.1, to globally install PythonWin (and the 'pywin32' module) to the base ArcGIS Pro Python install:

  1. Start a command window
  2. Execute the following lines:
    1. cd C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
    2. python -m pip install --upgrade pywin32
    3. python Scripts/pywin32_postinstall.py -install #this step is needed for the global install

My issue was that I had (only partially) installed PythonWin via the .exe installer, which was fudging up the whole thing.... pip wouldn't work... all messed up.  After uninstalling and cleaning all that mess up it finally worked. Hooray!

ChrisSnyder_0-1724944749045.jpeg

 

View solution in original post

3 Replies
Luke_Pinner
MVP Regular Contributor

The binary releases are deprecated, maybe they're broken as well?  The readme and the installer doc suggest installing with pip.  I'm not sure how well it would work with Pro's conda env, but perhaps something like the following which uses the --user flag might work? Can't test, no access to ArcGIS currently.

C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe -m pip install pywin32 --user

Alternatively, maybe clone arcgispro-py3 env and conda install to the cloned env?

 

 

 

ChrisSnyder
Honored Contributor

ChrisSnyder_1-1724950403241.png

 

0 Kudos
ChrisSnyder
Honored Contributor

After much struggle - PythonWin lives at ArcGIS Pro v3.3.1!

For future reference, the PythonWin.exe installer no longer works for Pro 3.3.1 – at least in Pro’s anaconda environment - and you seemly have to install via command prompt.

After installing Pro 3.3.1, to globally install PythonWin (and the 'pywin32' module) to the base ArcGIS Pro Python install:

  1. Start a command window
  2. Execute the following lines:
    1. cd C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3
    2. python -m pip install --upgrade pywin32
    3. python Scripts/pywin32_postinstall.py -install #this step is needed for the global install

My issue was that I had (only partially) installed PythonWin via the .exe installer, which was fudging up the whole thing.... pip wouldn't work... all messed up.  After uninstalling and cleaning all that mess up it finally worked. Hooray!

ChrisSnyder_0-1724944749045.jpeg