How to utilize an external installation type Python script
This guide will guide you through how to disable Xshell’s embedded python and instead utilize an external installation type Python script. Most users will have no issues using Xshell’s embedded Python (enabled by default), but this guide can be useful if you are running into errors and need to use an external Python script.
There are two main steps:
Downloading and Configuring Python
Configuring Xshell
Downloading and Configuring Python
Download and Install Python 3.7
To download Python, navigate to https://www.python.org/downloads/release/python-378/
Locate and download the Windows executable installer.
Install Python.
Make sure to check the following option when installing:
Download and Install Python for Windows Extensions
To download the Python for Windows Extensions, navigate to the following page: https://github.com/mhammond/pywin32/releases
Locate and download pywin32-228.win32-py3.7.exe.
Install the downloaded file.
When installing, make sure the directory paths are correctly set:
Register Python for Windows Extensions
Open CMD.
Navigate to the following directory:
> cd C:\Users\[“User name”]\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\win32comext\axscript\clientEnter the following command:
> python .\pyscript.py
Verify that you see the following results:
Requesting elevation and retrying...
Registered: Python
Designate the Python Directory in the Registry
Open the Windows Registry Editor (regedit)
Find the following registry key:
\HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{DF630910-1C1D-11d0-AE36-8C0F5E000000}\InprocServer32
Note: Navigating to \HKEY_CLASSES_ROOT\WOW6432Node\CLSID\ and searching for pythoncom37.dll may be faster.Change the path value of pythoncom37.dll to the full directory path in which this file exists. This directory is where you installed Python.
The default location is:
C:\Users\[“User name”]\AppData\Local\Programs\Python\Python37-32\Pythoncom37.dll
Configuring Xshell
Go into Xshell’s Options → Advanced and check the “Do not use Xshell’s embedded Python” option.
Run your desired Python script.
If you see the following error, then one or more of the settings above were not properly configured: