You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Author Name: Larry Shaffer (Larry Shaffer)
Original Redmine Issue: 6913
Affected QGIS version: master
Redmine category:python_plugins
A current issue regarding the loading of plugins (while running from the build directory) is when plugins are restored on launch of the app. There is currently a goofy fix for this with commits e31fb3c and where QgsApplication::pkgDataPath() is temporarily set to something other than QgsApplication::buildSourcePath() when restoring core plugins.
The reason for that patch: when QgsPluginRegistry::restoreSessionPlugins() is called the Python packages are imported from QgsApplication::buildSourcePath()/python/plugins even though that path is NOT in sys.path for the interpreter. If QgsApplication::pkgDataPath() is pointed to something other than QgsApplication::buildSourcePath(), or an empty QString, it works. However, I could find no means by which the interpreter was assigned that module search path.
I have tried:
changing the current working directory in C++ and via Python
setting PYTHONPATH
setting all kinds of debug output from the interpreter (never shows buildSourcePath()/python/plugins in sys.path)
giving up <-- that kinda worked
To reproduce the issue, run QGIS from the build directory and then launch DB Manager core plugin. You will get an error about a missing ui_*.py file, because that 'compiled' version of a *.ui file does not exist in source directory, only in the @build/output/python/plugins@ staged version of the plugin.
Now, run QGIS again, but with the @--noplugins@ option. This will keep @restoreSessionPlugins()@ from being called. After using Plugin Manager to turn back on DB Manager, launch the plugin and you should not get the error: sys.path is being honored, and the plugin is imported from @build/output/python/plugins@ staged area, as expected.
While the current patch works, it requires core plugins to not request QgsApplication::pkgDataPath() when the plugin loads. A better solution is needed.
Related issue(s): #15338 (relates)
Redmine related issue(s): 5879
The text was updated successfully, but these errors were encountered:
Author Name: Larry Shaffer (Larry Shaffer)
Original Redmine Issue: 6913
Affected QGIS version: master
Redmine category:python_plugins
A current issue regarding the loading of plugins (while running from the build directory) is when plugins are restored on launch of the app. There is currently a goofy fix for this with commits e31fb3c and where QgsApplication::pkgDataPath() is temporarily set to something other than QgsApplication::buildSourcePath() when restoring core plugins.
The reason for that patch: when QgsPluginRegistry::restoreSessionPlugins() is called the Python packages are imported from QgsApplication::buildSourcePath()/python/plugins even though that path is NOT in sys.path for the interpreter. If QgsApplication::pkgDataPath() is pointed to something other than QgsApplication::buildSourcePath(), or an empty QString, it works. However, I could find no means by which the interpreter was assigned that module search path.
I have tried:
To reproduce the issue, run QGIS from the build directory and then launch DB Manager core plugin. You will get an error about a missing ui_*.py file, because that 'compiled' version of a *.ui file does not exist in source directory, only in the @build/output/python/plugins@ staged version of the plugin.
Now, run QGIS again, but with the @--noplugins@ option. This will keep @restoreSessionPlugins()@ from being called. After using Plugin Manager to turn back on DB Manager, launch the plugin and you should not get the error: sys.path is being honored, and the plugin is imported from @build/output/python/plugins@ staged area, as expected.
While the current patch works, it requires core plugins to not request QgsApplication::pkgDataPath() when the plugin loads. A better solution is needed.
Related issue(s): #15338 (relates)
Redmine related issue(s): 5879
The text was updated successfully, but these errors were encountered: