g-sherman / Script-Runner

Run a Python script in QGIS to automate tasks
http://hub.qgis.org/projects/scriptrunner
9 stars 5 forks source link

Problem Installing ScriptRunner 3 #6

Closed bigzijing closed 6 years ago

bigzijing commented 6 years ago

Hello there. I have been trying to learn QGIS the past 2 weeks, and I have been following the PyQGIS Programmer's Guide by you (I have a working version of the one for QGIS 3), and I seem to have a problem installing ScriptRunner 3. Below are the error when I try to run the installation using QGIS Plugin Installations:

Couldn't load plugin 'scriptrunner3' due to an error when calling its classFactory() method 

ModuleNotFoundError: No module named 'win32api' 
Traceback (most recent call last):
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 336, in startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\scriptrunner3\__init__.py", line 24, in classFactory
    from .scriptrunner import ScriptRunner
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/zkang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\scriptrunner3\scriptrunner.py", line 27, in 
    import win32api
  File "C:/OSGEO4~1/apps/qgis/./python\qgis\utils.py", line 664, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'win32api'
g-sherman commented 6 years ago

The win32api module isn't included with python3 or with the QGIS installer.

You can install it using: python3 -m pip install pywin32

If you need help setting up your command line environment on windows, see: http://spatialgalaxy.net/2018/02/13/quick-guide-to-getting-started-with-pyqgis3-on-windows

I've added a warning about the requirement in the latest version (3.0.4) but it isn't available yet from the plugin repository.