Skip to main content

I follow steps mentioned in the KB article : Getting started with Python to install Python and do configuration to use ZOS-API with Python. But I still cannot make it work.


I did: 





  •  Install 64 bit Python 3.7.4 under C:\ directory  (according to recommendation)


  •  Configure Windows PATH environment 


  •  Install and upgrade pip 


  •  Install corresponding pywin32 module 


  •  Follow instructions under Troubleshooting python section to re-registering the wrappers 



    • Navigate to {Python}\Lib\site-packages\win32com\gen_py\*.* and delete all the filed in that (gen_py) directory.


    • Open a Windows "cmd” window (Windows Key + R -> type “cmd” -> press “Enter”)


    • Change directory to your {PythonEnv}\Lib\site-packages\wind32com\client\ folder (i.e., “cd C:\Python37\Lib\site-packages\win32com\client”)


    • Type “python makepy.py” and press enter.  When the Select Library window pops up, use the Ctrl key to select both the ZOSAPI and the ZOSAPI_Interfaces and click OK.











 



Problem of wrappers being broken usually can be fixed by above troubleshooting steps. 


But Python installation will have influence on imported module path. For my situation: 


Check generating to path when apply the troubleshooting steps in the Windows 'cmd' window. 


Note the module is imported into a different path, not under C:\Python37


Though system path of Python is under C:\ directory in my case, user path is not the right folder.    














My solution here is reinstall Python follow steps:




  1. Check 'Add Python 3.7 to PATH', click Customize installation: 




 


 


        2. Check all and Next:




        3. Choose folder C:\ by clicking Browse, please don't type in location path by hand :





4. install pywin32 module and back to CMD window to check if importing success.  


 



Reply