When running a script tool as a geoprocessing service, the tool fails, and returns the error message:
Error: ERROR 000816: The tool is not valid.
The tool runs successfully in ArcMap and ArcGIS Pro, and does not display any extended error information in the ArcGIS Server logs.
The script tool contains third-party modules unrecognized by ArcGIS Server.
ArcGIS Server utilizes the 64-bit version of Python. For any module not part of the core Python installation, ensure a 64-bit version of the module exists. For more information, refer to ArcGIS Server: Deploying custom Python packages for ArcGIS Server.
To install and import modules, follow these steps:
pip install <module_name>
Note: If these modules cannot be recognized, upgrade pip. To upgrade pip, launch Python Command Prompt, and navigate to C:\Python27\ArcGISx6410.x. Run the 'python -m pip install --upgrade pip' command to initiate the upgrade.