Bug report #16892

Processing in osgeo4w: ImportError: No module named expat; use SimpleXMLTreeBuilder instead

Added by Harrissou Santanna over 7 years ago. Updated over 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Windows Package
Affected QGIS version:master Regression?:No
Operating System:Windows 10 Easy fix?:No
Pull Request or Patch supplied:No Resolution:not reproducable
Crashes QGIS or corrupts data:No Copied to github as #:24791

Description

For days now, Launching QGIS nightly from osgeo4w 64bit result in a "Processing couldn't load" error with
ImportError: No module named expat; use SimpleXMLTreeBuilder instead message
During installation process I checked the libraries and there's an expat package at version 2.1.0-1 enabled.
Any Ideas?

Below the stacktrace:

ImportError: No module named expat; use SimpleXMLTreeBuilder instead 
Traceback (most recent call last):
File "C:\OSGEO4~1\apps\Python36\lib\xml\etree\ElementTree.py", line 1448, in __init__
from xml.parsers import expat
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGEO4~1\apps\Python36\lib\xml\parsers\expat.py", line 4, in 
from pyexpat import *
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: Le module spécifié est introuvable.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\OSGEO4~1\apps\Python36\lib\xml\etree\ElementTree.py", line 1451, in __init__
import pyexpat as expat
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed: Le module spécifié est introuvable.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 312, in loadPlugin
__import__(packageName)
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\__init__.py", line 29, in 
from processing.tools.general import *              # NOQA
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\tools\general.py", line 46, in 
from processing.core.Processing import Processing
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\core\Processing.py", line 53, in 
from processing.gui.MessageBarProgress import MessageBarProgress
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\gui\MessageBarProgress.py", line 32, in 
from processing.gui.MessageDialog import MessageDialog
File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\processing\gui\MessageDialog.py", line 38, in 
os.path.join(pluginPath, 'ui', 'DlgMessage.ui'))
File "C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\__init__.py", line 198, in loadUiType
winfo = compiler.UICompiler().compileUi(uifile, code_string, from_imports, resource_suffix, import_from)
File "C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\Compiler\compiler.py", line 110, in compileUi
w = self.parse(input_stream, resource_suffix)
File "C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\uiparser.py", line 1002, in parse
document = parse(filename)
File "C:\OSGEO4~1\apps\Python36\lib\xml\etree\ElementTree.py", line 1196, in parse
tree.parse(source, parser)
File "C:\OSGEO4~1\apps\Python36\lib\xml\etree\ElementTree.py", line 591, in parse
parser = XMLParser()
File "C:\OSGEO4~1\apps\Python36\lib\xml\etree\ElementTree.py", line 1454, in __init__
"No module named expat; use SimpleXMLTreeBuilder instead" 
ImportError: No module named expat; use SimpleXMLTreeBuilder instead

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] 
QGIS version: 2.99.0-Master Master, d70f53c 

Python Path:
C:/OSGEO4~1/apps/qgis-dev/./python
C:/Users/DelazJ/.qgis3/python
C:/Users/DelazJ/.qgis3/python/plugins
C:/OSGEO4~1/apps/qgis-dev/./python/plugins
C:\OSGeo4W64\apps\Python27\DLLs
C:\OSGeo4W64\bin\python36.zip
C:\OSGEO4~1\apps\Python36\DLLs
C:\OSGEO4~1\apps\Python36\lib
C:\OSGeo4W64\bin
C:\OSGEO4~1\apps\Python36
C:\OSGEO4~1\apps\Python36\lib\site-packages
C:/Users/DelazJ/.qgis3//python

History

#1 Updated by Jürgen Fischer about 7 years ago

  • Assignee deleted (Jürgen Fischer)

#2 Updated by Jürgen Fischer about 7 years ago

  • Description updated (diff)

#3 Updated by Harrissou Santanna about 7 years ago

Anyone has an idea here? This issue prevents me to have a working Processing in my windows computer. Note that I can see that expat library is checked in osgeo4w. Thanks.

#4 Updated by Giovanni Manghi about 7 years ago

  • Status changed from Open to Feedback

Just installed qgis-dev on osgeo4w and can't see this issue.

#5 Updated by Harrissou Santanna about 7 years ago

Just drop my osgeo4w64 folder and reinstall it. I still get the issue. Note that it begins by a "Couldn't load plugin 'Metasearch' due to an error when calling its classFactory() method" followed by the Processing issue i reported above.

Note that this only occurs on one of my two computers with Windows 10 64bit installed. So i'm not sure how easily reproducible it's.

#6 Updated by Alexander Bruy almost 7 years ago

Not reproducible here. Also I don't see how it can be related to Processing, as Processing does not need/use expat or SimpleXMLTreeBuilder.

#7 Updated by Harrissou Santanna almost 7 years ago

  • Status changed from Feedback to Closed

I don't know what are the internals of Processing: i just reported what was issued ie Processing couldn't load ... message among others.
Anyway, I don't know how nor when but I'm no longer concerned by this issue; things seem fixed here. So closing!

#8 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to not reproducable

Also available in: Atom PDF