Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
qgib opened this issue Jul 19, 2017 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS

Comments

@qgib
Copy link
Contributor

qgib commented Jul 19, 2017

Author Name: Harrissou Santanna (@DelazJ)
Original Redmine Issue: 16892
Affected QGIS version: master
Redmine category:windows_package


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

@qgib
Copy link
Contributor Author

qgib commented Sep 8, 2017

Author Name: Jürgen Fischer (@jef-n)


  • assigned_to_id removed Jürgen Fischer

@qgib
Copy link
Contributor Author

qgib commented Sep 8, 2017

Author Name: Jürgen Fischer (@jef-n)


  • description was changed from 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:\OSGEO41\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:\OSGEO41\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:\OSGEO41\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:/OSGEO41/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:/OSGEO41/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:/OSGEO41/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:/OSGEO41/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:/OSGEO41/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:\OSGEO41\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:\OSGEO41\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:/OSGEO41/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:\OSGEO41\apps\Python36\DLLs
C:\OSGEO4
1\apps\Python36\lib
C:\OSGeo4W64\bin
C:\OSGEO41\apps\Python36
C:\OSGEO4
1\apps\Python36\lib\site-packages
C:/Users/DelazJ/.qgis3//python to 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

@qgib
Copy link
Contributor Author

qgib commented Oct 31, 2017

Author Name: Harrissou Santanna (@DelazJ)


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.

@qgib
Copy link
Contributor Author

qgib commented Nov 2, 2017

Author Name: Giovanni Manghi (@gioman)


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


  • status_id was changed from Open to Feedback

@qgib
Copy link
Contributor Author

qgib commented Nov 2, 2017

Author Name: Harrissou Santanna (@DelazJ)


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.

@qgib
Copy link
Contributor Author

qgib commented Jan 17, 2018

Author Name: Alexander Bruy (@alexbruy)


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

@qgib
Copy link
Contributor Author

qgib commented Jan 18, 2018

Author Name: Harrissou Santanna (@DelazJ)


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!


  • status_id was changed from Feedback to Closed

@qgib qgib closed this as completed Jan 18, 2018
@qgib
Copy link
Contributor Author

qgib commented Feb 22, 2018

Author Name: Giovanni Manghi (@gioman)


  • resolution was changed from to not reproducable

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS labels May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS
Projects
None yet
Development

No branches or pull requests

1 participant