Cannot create pyqgis standalone application with the help of pyinstaller
What does an unprocessed RAW file look like?
Why don't you get burned by the wood benches in a sauna?
Are there historical references that show that "diatonic" is a version of 'di-tonic' meaning 'two tonics'?
What if I miss a connection and don't have money to book next flight?
Coworker asking me to not bring cakes due to self control issue. What should I do?
Is there a way to pause a running process on Linux systems and resume later?
Sing Baby Shark
What is an explicit bijection in combinatorics?
Is there any danger of my neighbor having my wife's signature?
What can I do to encourage my players to use their consumables?
In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?
Is it really OK to use "because of"?
Protagonist constantly has to have long words explained to her. Will this get tedious?
Sticky Strike or Sticky Delta
Why is it that Bernie Sanders is always called a "socialist"?
I have trouble understanding this fallacy: "If A, then B. Therefore if not-B, then not-A."
Are all power cords made equal?
Minimum Viable Product for RTS game?
Is the percentage symbol a constant?
Why do single electrical receptacles exist?
If I tried and failed to start my own business, how do I apply for a job without job experience?
Explicit way to check whether a function was called from within the Window
How would an EMP effect spacesuits (and small-arms weapons)?
Why did Ylvis use "go" instead of "say" in phrases like "Dog goes 'woof'"?
Cannot create pyqgis standalone application with the help of pyinstaller
I created a simple pyqgis application that consists of one file main_prj.py with the following content.
from qgis.core import QgsCoordinateTransform, QgsCoordinateReferenceSystem, QgsPointXY, QgsApplication
from PyQt5.QtWidgets import QApplication
import sys
def main():
print('Start program')
qgis_prefix_path = 'C:\OSGeo4W64\apps\qgis'
app = QApplication(sys.argv)
QgsApplication.setPrefixPath(qgis_prefix_path, True)
QgsApplication.initQgis()
cs_3857 = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)
cs_4326 = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
transform_4326_3857 = QgsCoordinateTransform()
transform_4326_3857.setSourceCrs(cs_4326)
transform_4326_3857.setDestinationCrs(cs_3857)
pnt = QgsPointXY(37.384, 49.764)
pn1 = transform_4326_3857.transform(pnt)
print(pn1)
input('Press Enter to stop')
QgsApplication.exitQgis()
if __name__ == '__main__':
main()
Actually, the app only calculates the coordinates defined in epsg:4326 into coordinates in epsg:3857
The output generated in Pycharm looks as follows
Start program
Press Enter to stop
Process finished with exit code 0
Then I try to generate executable using pyinstaller
pyinstaller main_prj.py
And get the following traceback
114 INFO: PyInstaller: 3.4 114 INFO: Python: 3.6.0 115 INFO:
Platform: Windows-10-10.0.14393-SP0 119 INFO: wrote
d:UsersBogomolovQgisTest_prjmain_prj.spec 167 INFO: UPX is
available. 169 INFO: Extending PYTHONPATH with paths
['d:UsersBogomolovQgisTest_prj',
'd:UsersBogomolovQgisTest_prj'] 170 INFO: checking Analysis
170 INFO: Building Analysis because Analysis-00.toc is non existent
171 INFO: Initializing module dependency graph... 175 INFO:
Initializing module graph hooks... 177 INFO: Analyzing
base_library.zip ... 3121 INFO: running Analysis Analysis-00.toc
3133 INFO: Adding Microsoft.Windows.Common-Controls to dependent
assemblies of final executable required by
c:osgeo4w64appspython36python.exe 3174 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3206 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3242 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3281 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3319 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3357 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3393 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3430 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3466 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3499 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3611 WARNING: lib not found:
api-ms-win-crt-environment-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3645 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3678 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3710 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3741 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3774 WARNING: lib not found:
api-ms-win-crt-conio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3806 WARNING: lib not found:
api-ms-win-crt-filesystem-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3840 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3875 WARNING: lib not found:
api-ms-win-crt-process-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3907 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3941 WARNING: lib not found:
api-ms-win-crt-time-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3976 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3981 INFO: Caching module hooks...
3987 INFO: Analyzing d:UsersBogomolovQgisTest_prjmain_prj.py
4026 INFO: Loading module hooks... 4027 INFO: Loading module hook
"hook-encodings.py"... 4128 INFO: Loading module hook
"hook-pydoc.py"... 4130 INFO: Loading module hook "hook-PyQt5.py"...
4214 WARNING: Cannot read QLibraryInfo output: raised Expecting
value: line 1 column 1 (char 0) when decoding: Traceback (most
recent call last): File "", line 11, in
ImportError: DLL load failed: Не найден указанный модуль.
Traceback (most recent call last): File
"c:OSGeo4W64appsPython36librunpy.py", line 193, in
_run_module_as_main "main", mod_spec) File "c:OSGeo4W64appsPython36librunpy.py", line 85, in _run_code
exec(code, run_globals) File
"c:OSGEO4W64appsPython36Scriptspyinstaller.exe__main__.py",
line 9, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 111, in run run_build(pyi_config, spec_file, **vars(args))
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file,
**kwargs) File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 838, in main build(specfile, kw.get('distpath'),
kw.get('workpath'), kw.get('clean_build')) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 784, in build exec(text, spec_namespace) File "",
line 17, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 241, in init self.postinit() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingdatastruct.py",
line 158, in postinit self.assemble() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 500, in assemble module_hook.post_graph() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 410, in post_graph self._load_hook_module() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 377, in _load_hook_module self.hook_module_name,
self.hook_filename) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallercompat.py",
line 736, in importlib_load_source return
mod_loader.load_module() File "", line 399, in _check_name_wrapper
File "", line 823, in
load_module File "", line
682, in load_module File "", line
251, in _load_module_shim File "",
line 675, in _load File "", line
655, in _load_unlocked File "", line 678, in exec_module File
"", line 205, in
_call_with_frames_removed File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerhookshook-PyQt5.py",
line 23, in
collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerutilshooksqt.py",
line 67, in getattr qli = json.loads(json_str) File
"c:OSGeo4W64appsPython36libjson__init__.py", line 354, in
loads return _default_decoder.decode(s) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 339, in
decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 357, in
raw_decode raise JSONDecodeError("Expecting value", s, err.value)
from None json.decoder.JSONDecodeError: Expecting value: line 1
column 1 (char 0)
What I have done wrong or have not taken into consideration?
pyqgis.qt.pyinstaller
add a comment |
I created a simple pyqgis application that consists of one file main_prj.py with the following content.
from qgis.core import QgsCoordinateTransform, QgsCoordinateReferenceSystem, QgsPointXY, QgsApplication
from PyQt5.QtWidgets import QApplication
import sys
def main():
print('Start program')
qgis_prefix_path = 'C:\OSGeo4W64\apps\qgis'
app = QApplication(sys.argv)
QgsApplication.setPrefixPath(qgis_prefix_path, True)
QgsApplication.initQgis()
cs_3857 = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)
cs_4326 = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
transform_4326_3857 = QgsCoordinateTransform()
transform_4326_3857.setSourceCrs(cs_4326)
transform_4326_3857.setDestinationCrs(cs_3857)
pnt = QgsPointXY(37.384, 49.764)
pn1 = transform_4326_3857.transform(pnt)
print(pn1)
input('Press Enter to stop')
QgsApplication.exitQgis()
if __name__ == '__main__':
main()
Actually, the app only calculates the coordinates defined in epsg:4326 into coordinates in epsg:3857
The output generated in Pycharm looks as follows
Start program
Press Enter to stop
Process finished with exit code 0
Then I try to generate executable using pyinstaller
pyinstaller main_prj.py
And get the following traceback
114 INFO: PyInstaller: 3.4 114 INFO: Python: 3.6.0 115 INFO:
Platform: Windows-10-10.0.14393-SP0 119 INFO: wrote
d:UsersBogomolovQgisTest_prjmain_prj.spec 167 INFO: UPX is
available. 169 INFO: Extending PYTHONPATH with paths
['d:UsersBogomolovQgisTest_prj',
'd:UsersBogomolovQgisTest_prj'] 170 INFO: checking Analysis
170 INFO: Building Analysis because Analysis-00.toc is non existent
171 INFO: Initializing module dependency graph... 175 INFO:
Initializing module graph hooks... 177 INFO: Analyzing
base_library.zip ... 3121 INFO: running Analysis Analysis-00.toc
3133 INFO: Adding Microsoft.Windows.Common-Controls to dependent
assemblies of final executable required by
c:osgeo4w64appspython36python.exe 3174 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3206 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3242 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3281 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3319 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3357 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3393 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3430 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3466 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3499 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3611 WARNING: lib not found:
api-ms-win-crt-environment-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3645 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3678 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3710 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3741 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3774 WARNING: lib not found:
api-ms-win-crt-conio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3806 WARNING: lib not found:
api-ms-win-crt-filesystem-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3840 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3875 WARNING: lib not found:
api-ms-win-crt-process-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3907 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3941 WARNING: lib not found:
api-ms-win-crt-time-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3976 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3981 INFO: Caching module hooks...
3987 INFO: Analyzing d:UsersBogomolovQgisTest_prjmain_prj.py
4026 INFO: Loading module hooks... 4027 INFO: Loading module hook
"hook-encodings.py"... 4128 INFO: Loading module hook
"hook-pydoc.py"... 4130 INFO: Loading module hook "hook-PyQt5.py"...
4214 WARNING: Cannot read QLibraryInfo output: raised Expecting
value: line 1 column 1 (char 0) when decoding: Traceback (most
recent call last): File "", line 11, in
ImportError: DLL load failed: Не найден указанный модуль.
Traceback (most recent call last): File
"c:OSGeo4W64appsPython36librunpy.py", line 193, in
_run_module_as_main "main", mod_spec) File "c:OSGeo4W64appsPython36librunpy.py", line 85, in _run_code
exec(code, run_globals) File
"c:OSGEO4W64appsPython36Scriptspyinstaller.exe__main__.py",
line 9, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 111, in run run_build(pyi_config, spec_file, **vars(args))
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file,
**kwargs) File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 838, in main build(specfile, kw.get('distpath'),
kw.get('workpath'), kw.get('clean_build')) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 784, in build exec(text, spec_namespace) File "",
line 17, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 241, in init self.postinit() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingdatastruct.py",
line 158, in postinit self.assemble() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 500, in assemble module_hook.post_graph() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 410, in post_graph self._load_hook_module() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 377, in _load_hook_module self.hook_module_name,
self.hook_filename) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallercompat.py",
line 736, in importlib_load_source return
mod_loader.load_module() File "", line 399, in _check_name_wrapper
File "", line 823, in
load_module File "", line
682, in load_module File "", line
251, in _load_module_shim File "",
line 675, in _load File "", line
655, in _load_unlocked File "", line 678, in exec_module File
"", line 205, in
_call_with_frames_removed File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerhookshook-PyQt5.py",
line 23, in
collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerutilshooksqt.py",
line 67, in getattr qli = json.loads(json_str) File
"c:OSGeo4W64appsPython36libjson__init__.py", line 354, in
loads return _default_decoder.decode(s) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 339, in
decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 357, in
raw_decode raise JSONDecodeError("Expecting value", s, err.value)
from None json.decoder.JSONDecodeError: Expecting value: line 1
column 1 (char 0)
What I have done wrong or have not taken into consideration?
pyqgis.qt.pyinstaller
add a comment |
I created a simple pyqgis application that consists of one file main_prj.py with the following content.
from qgis.core import QgsCoordinateTransform, QgsCoordinateReferenceSystem, QgsPointXY, QgsApplication
from PyQt5.QtWidgets import QApplication
import sys
def main():
print('Start program')
qgis_prefix_path = 'C:\OSGeo4W64\apps\qgis'
app = QApplication(sys.argv)
QgsApplication.setPrefixPath(qgis_prefix_path, True)
QgsApplication.initQgis()
cs_3857 = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)
cs_4326 = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
transform_4326_3857 = QgsCoordinateTransform()
transform_4326_3857.setSourceCrs(cs_4326)
transform_4326_3857.setDestinationCrs(cs_3857)
pnt = QgsPointXY(37.384, 49.764)
pn1 = transform_4326_3857.transform(pnt)
print(pn1)
input('Press Enter to stop')
QgsApplication.exitQgis()
if __name__ == '__main__':
main()
Actually, the app only calculates the coordinates defined in epsg:4326 into coordinates in epsg:3857
The output generated in Pycharm looks as follows
Start program
Press Enter to stop
Process finished with exit code 0
Then I try to generate executable using pyinstaller
pyinstaller main_prj.py
And get the following traceback
114 INFO: PyInstaller: 3.4 114 INFO: Python: 3.6.0 115 INFO:
Platform: Windows-10-10.0.14393-SP0 119 INFO: wrote
d:UsersBogomolovQgisTest_prjmain_prj.spec 167 INFO: UPX is
available. 169 INFO: Extending PYTHONPATH with paths
['d:UsersBogomolovQgisTest_prj',
'd:UsersBogomolovQgisTest_prj'] 170 INFO: checking Analysis
170 INFO: Building Analysis because Analysis-00.toc is non existent
171 INFO: Initializing module dependency graph... 175 INFO:
Initializing module graph hooks... 177 INFO: Analyzing
base_library.zip ... 3121 INFO: running Analysis Analysis-00.toc
3133 INFO: Adding Microsoft.Windows.Common-Controls to dependent
assemblies of final executable required by
c:osgeo4w64appspython36python.exe 3174 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3206 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3242 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3281 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3319 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3357 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3393 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3430 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3466 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3499 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3611 WARNING: lib not found:
api-ms-win-crt-environment-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3645 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3678 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3710 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3741 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3774 WARNING: lib not found:
api-ms-win-crt-conio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3806 WARNING: lib not found:
api-ms-win-crt-filesystem-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3840 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3875 WARNING: lib not found:
api-ms-win-crt-process-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3907 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3941 WARNING: lib not found:
api-ms-win-crt-time-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3976 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3981 INFO: Caching module hooks...
3987 INFO: Analyzing d:UsersBogomolovQgisTest_prjmain_prj.py
4026 INFO: Loading module hooks... 4027 INFO: Loading module hook
"hook-encodings.py"... 4128 INFO: Loading module hook
"hook-pydoc.py"... 4130 INFO: Loading module hook "hook-PyQt5.py"...
4214 WARNING: Cannot read QLibraryInfo output: raised Expecting
value: line 1 column 1 (char 0) when decoding: Traceback (most
recent call last): File "", line 11, in
ImportError: DLL load failed: Не найден указанный модуль.
Traceback (most recent call last): File
"c:OSGeo4W64appsPython36librunpy.py", line 193, in
_run_module_as_main "main", mod_spec) File "c:OSGeo4W64appsPython36librunpy.py", line 85, in _run_code
exec(code, run_globals) File
"c:OSGEO4W64appsPython36Scriptspyinstaller.exe__main__.py",
line 9, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 111, in run run_build(pyi_config, spec_file, **vars(args))
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file,
**kwargs) File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 838, in main build(specfile, kw.get('distpath'),
kw.get('workpath'), kw.get('clean_build')) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 784, in build exec(text, spec_namespace) File "",
line 17, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 241, in init self.postinit() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingdatastruct.py",
line 158, in postinit self.assemble() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 500, in assemble module_hook.post_graph() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 410, in post_graph self._load_hook_module() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 377, in _load_hook_module self.hook_module_name,
self.hook_filename) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallercompat.py",
line 736, in importlib_load_source return
mod_loader.load_module() File "", line 399, in _check_name_wrapper
File "", line 823, in
load_module File "", line
682, in load_module File "", line
251, in _load_module_shim File "",
line 675, in _load File "", line
655, in _load_unlocked File "", line 678, in exec_module File
"", line 205, in
_call_with_frames_removed File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerhookshook-PyQt5.py",
line 23, in
collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerutilshooksqt.py",
line 67, in getattr qli = json.loads(json_str) File
"c:OSGeo4W64appsPython36libjson__init__.py", line 354, in
loads return _default_decoder.decode(s) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 339, in
decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 357, in
raw_decode raise JSONDecodeError("Expecting value", s, err.value)
from None json.decoder.JSONDecodeError: Expecting value: line 1
column 1 (char 0)
What I have done wrong or have not taken into consideration?
pyqgis.qt.pyinstaller
I created a simple pyqgis application that consists of one file main_prj.py with the following content.
from qgis.core import QgsCoordinateTransform, QgsCoordinateReferenceSystem, QgsPointXY, QgsApplication
from PyQt5.QtWidgets import QApplication
import sys
def main():
print('Start program')
qgis_prefix_path = 'C:\OSGeo4W64\apps\qgis'
app = QApplication(sys.argv)
QgsApplication.setPrefixPath(qgis_prefix_path, True)
QgsApplication.initQgis()
cs_3857 = QgsCoordinateReferenceSystem(3857, QgsCoordinateReferenceSystem.EpsgCrsId)
cs_4326 = QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId)
transform_4326_3857 = QgsCoordinateTransform()
transform_4326_3857.setSourceCrs(cs_4326)
transform_4326_3857.setDestinationCrs(cs_3857)
pnt = QgsPointXY(37.384, 49.764)
pn1 = transform_4326_3857.transform(pnt)
print(pn1)
input('Press Enter to stop')
QgsApplication.exitQgis()
if __name__ == '__main__':
main()
Actually, the app only calculates the coordinates defined in epsg:4326 into coordinates in epsg:3857
The output generated in Pycharm looks as follows
Start program
Press Enter to stop
Process finished with exit code 0
Then I try to generate executable using pyinstaller
pyinstaller main_prj.py
And get the following traceback
114 INFO: PyInstaller: 3.4 114 INFO: Python: 3.6.0 115 INFO:
Platform: Windows-10-10.0.14393-SP0 119 INFO: wrote
d:UsersBogomolovQgisTest_prjmain_prj.spec 167 INFO: UPX is
available. 169 INFO: Extending PYTHONPATH with paths
['d:UsersBogomolovQgisTest_prj',
'd:UsersBogomolovQgisTest_prj'] 170 INFO: checking Analysis
170 INFO: Building Analysis because Analysis-00.toc is non existent
171 INFO: Initializing module dependency graph... 175 INFO:
Initializing module graph hooks... 177 INFO: Analyzing
base_library.zip ... 3121 INFO: running Analysis Analysis-00.toc
3133 INFO: Adding Microsoft.Windows.Common-Controls to dependent
assemblies of final executable required by
c:osgeo4w64appspython36python.exe 3174 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3206 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3242 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3281 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3319 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:osgeo4w64appspython36python.exe 3357 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3393 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3430 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3466 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3499 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
C:Windowssystem32vcruntime140.dll 3611 WARNING: lib not found:
api-ms-win-crt-environment-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3645 WARNING: lib not found:
api-ms-win-crt-math-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3678 WARNING: lib not found:
api-ms-win-crt-string-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3710 WARNING: lib not found:
api-ms-win-crt-stdio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3741 WARNING: lib not found:
api-ms-win-crt-heap-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3774 WARNING: lib not found:
api-ms-win-crt-conio-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3806 WARNING: lib not found:
api-ms-win-crt-filesystem-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3840 WARNING: lib not found:
api-ms-win-crt-convert-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3875 WARNING: lib not found:
api-ms-win-crt-process-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3907 WARNING: lib not found:
api-ms-win-crt-locale-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3941 WARNING: lib not found:
api-ms-win-crt-time-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3976 WARNING: lib not found:
api-ms-win-crt-runtime-l1-1-0.dll dependency of
c:OSGEO4W64binpython36.dll 3981 INFO: Caching module hooks...
3987 INFO: Analyzing d:UsersBogomolovQgisTest_prjmain_prj.py
4026 INFO: Loading module hooks... 4027 INFO: Loading module hook
"hook-encodings.py"... 4128 INFO: Loading module hook
"hook-pydoc.py"... 4130 INFO: Loading module hook "hook-PyQt5.py"...
4214 WARNING: Cannot read QLibraryInfo output: raised Expecting
value: line 1 column 1 (char 0) when decoding: Traceback (most
recent call last): File "", line 11, in
ImportError: DLL load failed: Не найден указанный модуль.
Traceback (most recent call last): File
"c:OSGeo4W64appsPython36librunpy.py", line 193, in
_run_module_as_main "main", mod_spec) File "c:OSGeo4W64appsPython36librunpy.py", line 85, in _run_code
exec(code, run_globals) File
"c:OSGEO4W64appsPython36Scriptspyinstaller.exe__main__.py",
line 9, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 111, in run run_build(pyi_config, spec_file, **vars(args))
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstaller__main__.py",
line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file,
**kwargs) File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 838, in main build(specfile, kw.get('distpath'),
kw.get('workpath'), kw.get('clean_build')) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 784, in build exec(text, spec_namespace) File "",
line 17, in File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 241, in init self.postinit() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingdatastruct.py",
line 158, in postinit self.assemble() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingbuild_main.py",
line 500, in assemble module_hook.post_graph() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 410, in post_graph self._load_hook_module() File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerbuildingimphook.py",
line 377, in _load_hook_module self.hook_module_name,
self.hook_filename) File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallercompat.py",
line 736, in importlib_load_source return
mod_loader.load_module() File "", line 399, in _check_name_wrapper
File "", line 823, in
load_module File "", line
682, in load_module File "", line
251, in _load_module_shim File "",
line 675, in _load File "", line
655, in _load_unlocked File "", line 678, in exec_module File
"", line 205, in
_call_with_frames_removed File "c:OSGeo4W64appsPython36libsite-packagesPyInstallerhookshook-PyQt5.py",
line 23, in
collect_system_data_files(pyqt5_library_info.location['PrefixPath'],
File
"c:OSGeo4W64appsPython36libsite-packagesPyInstallerutilshooksqt.py",
line 67, in getattr qli = json.loads(json_str) File
"c:OSGeo4W64appsPython36libjson__init__.py", line 354, in
loads return _default_decoder.decode(s) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 339, in
decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File
"c:OSGeo4W64appsPython36libjsondecoder.py", line 357, in
raw_decode raise JSONDecodeError("Expecting value", s, err.value)
from None json.decoder.JSONDecodeError: Expecting value: line 1
column 1 (char 0)
What I have done wrong or have not taken into consideration?
pyqgis.qt.pyinstaller
pyqgis.qt.pyinstaller
asked Jan 26 at 12:23
VadymVadym
61618
61618
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I got the same problem. Have U fixed this?
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f309988%2fcannot-create-pyqgis-standalone-application-with-the-help-of-pyinstaller%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got the same problem. Have U fixed this?
New contributor
add a comment |
I got the same problem. Have U fixed this?
New contributor
add a comment |
I got the same problem. Have U fixed this?
New contributor
I got the same problem. Have U fixed this?
New contributor
New contributor
answered 11 mins ago
user137599user137599
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f309988%2fcannot-create-pyqgis-standalone-application-with-the-help-of-pyinstaller%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown