-
Notifications
You must be signed in to change notification settings - Fork 112
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
QGIS3/GRASS: error while executing a script #452
Comments
I've built Grass7 form source using this formula and rebuilt qgis3 and the problem is still there. |
Where should I change that you mention on |
@luisspuerto I think that GRASS startup program |
This isn't fixed by the last merge #446, is it? |
@luisspuerto I have not reviewed this problem. Can you test the above? |
After the problems I report in #456, I've tried to run a grass script and I get the following:
Here the full output. |
By the way after the rebuilding of qgis3 —I don't know how many times— I've noticed the following lines...
|
@luisspuerto The tab/space issue is an upstream problem in grass, I think it was first reported in #228. I'll try and create a patch and upgrade the grass formula. |
In qgis2 everything works! thankgod! |
I just updated to QGIS3 and QGIS2. In QGIS2 everything seems to work perfectly, but in QGIS3 the error is still there... 😞 |
@luisspuerto, the problem is in GRASS, @nickrobison will create a patch to solve it. |
@luispuerto, is this still happening? If it is solved we close this issue |
@fjperini No... sadly isn't working... but I think it's different error now:
grass log window:
In QGIS2 works. I also tested other script in grass I the same/similar error. |
PS/ by the way all the others works perfectly, including saga, que didn't work before. orfeo6 disappeared again, but I guess you still working in implementation, don't you? |
I just install QGIS 3.4.1 and the error still happening... I guess it's a QGIS issue. |
Additional info in the geoprocessing log:
TabError: inconsistent use of tabs and spaces in indentation Well... I don't know. I don't know why this happens in QGIS3 but not in 2. |
@luispuerto This commented @nickrobison in #228
Regarding the problem with PYTHON, I noticed that in src/plugins/grass/qgsgrassshell.cpp:
It is very likely that you are calling Another thing you can do to make sure:
GRASS addons may fail due to
Should be changed into
Try this and then tell me how it turned out! p/d: Yes, I am working on the implementation of orfeo6, I applied several changes with respect to #461 #462. |
@fjperini I can try to change python 3 for 2 for grass, but I really don't know how to do it inside the QGIS3 app. I really understand about the shebang, but I'm not scripting, I'm trying to use just the v.buffer script form the grass toolbox in QIGS3. |
@luispuerto I get it! |
@luispuerto @nickrobison It seems that I had to apply several changes. For the error I think this error occurs when QGIS starts with another Check what kind of local variables:
I added it to
UPDATE: It is not enough to put it in For the error I had to change the next line
to
p/d: I hope it works, at least I was not presented with the errors that were previously. |
😱 this is grasstantic I can wait to test it! |
It is! First we will have to merge Grasstantic 😄 Well said! |
As mentioned @msandifo (see), a solution:
which can be applied by @nickrobison #549 :
or, with the patch that was to apply:
Once merged #549, I will apply the other changes. @luispuerto When the bottle for qt5-webkit is ready, I to apply changes in |
@luispuerto I'm about to upload the other changes! |
@luispuerto You can try the changes, in the course of the day I apply to They are all integrated and functioning. |
Great! @fjperini are the changes related to the last 3 pull request? I can download them and merge locally in a branch and test them |
@luispuerto We finally beat GRASS. At some point you'll have to give me that beer. Ha! Yes, it is necessary to delete the previous profile to avoid inconveniences. Keep testing and then tell me. |
@fjperini where do you live? if you live in Spain perhaps we have a chance this Christmas |
Addressed issues reported in #452. Added additional optional dependencies to improve formula capabilities
@luispuerto We are far, I to a sea. Ha! But soon I will be walking through the old continent. The integration of R and ORFEO is completed. It will only be necessary to enable them from I was workining to configure the default folders and activate the plugin when it is enabled:
I correct the |
@fjperini @luispuerto I would be more than happy to buy you each a beer this Christmas, if you let me know where to send the money! One for @luispuerto for finding all the errors, and one for @fjperini for fixing them! |
@nickrobison as far I see you are based in Seattle, perhaps I will go around the great Pacific North West after the summer for a couple of months. 🍻 ? PS/ You have a lot of trees around there 🌲 🌲 🌲 🌲 🌲 🌲 🌲 🌲 I'm a forester. |
@luispuerto Did you verify that GRASS works 100%? To confirm that it was resolved and close this issue. @nickrobison With the R, ORFEO and GLOBE resolved, it will have to be a full beer box. What do we do, do we demand it? 😄 We will continue the talk here #431 for the integration of ORFEO. I finish testing the p/p: It would be great to be able to meet! |
@fjperini I run a couple of scripts more... but they aren't working. this is the log while running
This time seems something related with python (again). |
by the way... I just tried the vector buffer from gdal in QGIS2 and it's not working, but in QGIS3 it's... I just testing.... but I really convinced that we are going to need to have two qgis for quite some time. |
@luispuerto You have that error:
I'll check.
There may be another line with Verify that the change is applied in |
my def set_paths(grass_config_dir):
# addons (path)
addon_path = os.getenv('GRASS_ADDON_PATH')
if addon_path:
for path in addon_path.split(os.pathsep):
path_prepend(addon_path, 'PATH')
# addons (base)
addon_base = os.getenv('GRASS_ADDON_BASE')
if not addon_base:
addon_base = os.path.join(grass_config_dir, 'addons')
os.environ['GRASS_ADDON_BASE'] = addon_base
if not windows:
path_prepend(os.path.join(addon_base, 'scripts'), 'PATH')
path_prepend(os.path.join(addon_base, 'bin'), 'PATH')
# standard installation
if not windows:
path_prepend(gpath('scripts'), 'PATH')
path_prepend(gpath('bin'), 'PATH')
# Set PYTHONPATH to find GRASS Python modules
if os.path.exists(gpath('etc', 'python')):
path_prepend(gpath('etc', 'python'), 'PYTHONPATH')
# set path for the GRASS man pages
grass_man_path = gpath('docs', 'man')
addons_man_path = os.path.join(addon_base, 'docs', 'man')
man_path = os.getenv('MANPATH')
sys_man_path = None
if man_path:
path_prepend(addons_man_path, 'MANPATH')
path_prepend(grass_man_path, 'MANPATH')
else:
try:
nul = open(os.devnull, 'w')
p = Popen(['manpath'], stdout=subprocess.PIPE, stderr=nul)
nul.close()
s = p.stdout.read()
p.wait()
sys_man_path = s.strip()
except:
pass
if sys_man_path:
# to_text_string disabled, see https://trac.osgeo.org/grass/ticket/3508
# os.environ['MANPATH'] = to_text_string(sys_man_path)
os.environ['MANPATH'] = str(sys_man_path)
path_prepend(addons_man_path, 'MANPATH')
path_prepend(grass_man_path, 'MANPATH')
else:
# to_text_string disabled, see https://trac.osgeo.org/grass/ticket/3508
# os.environ['MANPATH'] = to_text_string(addons_man_path)
os.environ['MANPATH'] = addons_man_path
path_prepend(grass_man_path, 'MANPATH')
# Set LD_LIBRARY_PATH (etc) to find GRASS shared libraries
# this works for subprocesses but won't affect the current process
path_prepend(gpath("lib"), ld_library_path_var) |
@luispuerto I checked that with It seems that now we have to correct the file: |
@luispuerto I'm testing others |
@fjperini you are right... what an eye have! I swear that |
The other one that I found is: I will try to solve the problem in core.py if that is the correct file. Ha! It would be necessary to report them to the developers. They are upstream problems anyway. Everything else seems to work well. |
Great 🎈 But if it’s an upstream problem why do they work on QGIS2? Sent with GitHawk |
@luispuerto It may be by the python version:
QGIS2 uses Python 2. If you see in the comment
for example for the first case: There are things that change and may need to be adjusted from version to version. |
@luispuerto A line within
Maybe the problem is in
Definitely related Python 2 and Python 3 differences:
Apparently, only https://trac.osgeo.org/grass/wiki/Python3Support |
Here is a solution mentioned: https://stackoverflow.com/questions/52269281/fix-import-error-on-using-environb-in-python
We are very close to solving it. |
@luispuerto @nickrobison I've solved With all the changes applied, GRASS should be completely compatible with Python 3. While we wait for version 7.8/8.0, which apparently (https://gis.stackexchange.com/a/304598) will be compatible with Python 3. Files to which I had to apply changes:
and to the remaining files just change
note: I will apply the changes now! p/d: If a similar error arises, you already know where to start. Now I want that beer 😄 Ha! |
The But I found many things to change for the new versions (3.6.3). For that I will upload new formulas that includes the support for Qt5 necessary to build some libraries, for example:
needed by
Apparently I just need to correct an error (after many) so that the build is completed.
I hope to solve it. Ha! |
@nickrobison As there are several changes for Python 3, it might be best to create a @luispuerto I'll give you the formula with the changes and the tests in QGIS 2 and QGIS3. If something comes up in QGIS 2, we'll have to use |
Tell me which branch in your repo or which pull request I should use. |
@luispuerto You can already try it! |
I just tested it Again, great work! |
Once @nickrobison merge the changes we close this. Ha! Thanks @luispuerto! |
Problem reported by @luisspuerto
The text was updated successfully, but these errors were encountered: