[osgeo4w-dev] python3 error in OSGeo4W-64bit: Fatal Python error: Py_Initialize: unable to load the file system codec

Helmut Kudrnovsky hellik at web.de
Mon Feb 27 05:55:01 PST 2017


hi,

I want to try out QGIS-Version: 2.99.0-Master in OSGeo4W-64bit; this dev
version needs python 3 which is installed by the OSGeo4W-64bit.

when I type python3 into the OSGeo4W-shell, python3 crashes with following
error:

-------------
C:\>python3
Fatal Python error: Py_Initialize: unable to load the file system codec
  File "C:\OSGEO4~1\apps\Python27\lib\encodings\__init__.py", line 123
    raise CodecRegistryError,\
                            ^
SyntaxError: invalid syntax

Current thread 0x00000fe4 (most recent call first):
------------

when I start QGIS-Version: 2.99.0-Master, some python3 warnings:

-----------
2017-02-27T14:51:10	1
warning:C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\objcreator.py:152:
DeprecationWarning: 'U' mode is deprecated
			  plugin = open(filename, 'rU')
			
			traceback:  File "<string>", line 1, in <module>
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 338, in
startPlugin
			    plugins[packageName] = package.classFactory(iface)
			  File
"C:/OSGEO4~1/apps/qgis-dev/./python/plugins\MetaSearch\__init__.py", line
29, in classFactory
			    from MetaSearch.plugin import MetaSearchPlugin
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in
_import
			    mod = _builtin_import(name, globals, locals, fromlist, level)
			  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
			  File "<frozen importlib._bootstrap>", line 950, in
_find_and_load_unlocked
			  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
			  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
			  File "<frozen importlib._bootstrap>", line 205, in
_call_with_frames_removed
			  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\MetaSearch\plugin.py",
line 34, in <module>
			    from MetaSearch.dialogs.maindialog import MetaSearchDialog
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in
_import
			    mod = _builtin_import(name, globals, locals, fromlist, level)
			  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
			  File "<frozen importlib._bootstrap>", line 950, in
_find_and_load_unlocked
			  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
			  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
			  File "<frozen importlib._bootstrap>", line 205, in
_call_with_frames_removed
			  File
"C:/OSGEO4~1/apps/qgis-dev/./python/plugins\MetaSearch\dialogs\maindialog.py",
line 53, in <module>
			    from MetaSearch.dialogs.manageconnectionsdialog import
ManageConnectionsDialog
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in
_import
			    mod = _builtin_import(name, globals, locals, fromlist, level)
			  File "<frozen importlib._bootstrap>", line 961, in _find_and_load
			  File "<frozen importlib._bootstrap>", line 950, in
_find_and_load_unlocked
			  File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
			  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
			  File "<frozen importlib._bootstrap>", line 205, in
_call_with_frames_removed
			  File
"C:/OSGEO4~1/apps/qgis-dev/./python/plugins\MetaSearch\dialogs\manageconnectionsdialog.py",
line 38, in <module>
			    BASE_CLASS = get_ui_class('manageconnectionsdialog.ui')
			  File "C:/OSGEO4~1/apps/qgis-dev/./python/plugins\MetaSearch\util.py",
line 73, in get_ui_class
			    return loadUiType(ui_file_full)[0]
			  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 53, in __init__
			    qtproxies.QtWidgets, CompilerCreatorPolicy())
			  File
"C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\uiparser.py", line
166, in __init__
			    self.factory = QObjectCreator(creatorPolicy)
			  File
"C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\objcreator.py", line
85, in __init__
			    if self.load_plugin(filename, plugin_globals, plugin_locals):
			  File
"C:\OSGEO4~1\apps\Python36\lib\site-packages\PyQt5\uic\objcreator.py", line
152, in load_plugin
			    plugin = open(filename, 'rU')
-----------

and some python errors:

----------
2017-02-27T14:51:11	1	Traceback (most recent call last):
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 313, 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 <module>
			    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 38, in <module>
			    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 46, in <module>
			    from processing.script.ScriptUtils import ScriptUtils
			  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\script\ScriptUtils.py",
line 32, in <module>
			    from processing.script.ScriptAlgorithm import ScriptAlgorithm
			  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\script\ScriptAlgorithm.py",
line 37, in <module>
			    from processing.core.GeoAlgorithm import GeoAlgorithm
			  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\GeoAlgorithm.py",
line 48, in <module>
			    from processing.algs.help import shortHelp
			  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\algs\help\__init__.py",
line 28, in <module>
			    import yaml
			  File "C:/OSGEO4~1/apps/qgis-dev/./python\qgis\utils.py", line 647, in
_import
			    mod = _builtin_import(name, globals, locals, fromlist, level)
			ImportError: bad magic number in 'yaml': b'\x03\xf3\r\n'
-----------------------

any hints?



-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/python3-error-in-OSGeo4W-64bit-Fatal-Python-error-Py-Initialize-unable-to-load-the-file-system-codec-tp5309682.html
Sent from the osgeo4w-dev -- OSGeo Win32 Installer List mailing list archive at Nabble.com.


More information about the osgeo4w-dev mailing list