Hi again, Yes, this seems to be a Python2/3 issue. Good suggestions from Vero. Enrico, can also try to replace python3 with just python in the shebang (first line in the script)?
Cheers Stefan From: Veronica Andreo <veroand...@gmail.com> Sent: mandag 8. mars 2021 12:38 To: Enrico Gabrielli bonushenricus <bonushenricu...@gmail.com> Cc: Stefan Blumentrath <stefan.blumentr...@nina.no>; grass-user@lists.osgeo.org Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of 7.8) in GRASS 7.6 Hi Enrico, GRASS 7.6 is the last using python 2, and in 7.8 we moved to python 3, though still supporting python 2. Could that be a problem? What about compiling GRASS 7.8+ if not in the Debian stable repos? https://grasswiki.osgeo.org/wiki/Compile_and_Install#Debian<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgrasswiki.osgeo.org%2Fwiki%2FCompile_and_Install%23Debian&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002815993017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=R7UVMefbQoGJbH7Hy4rfjjI0qDfREnG1XyMZ3f1nNtE%3D&reserved=0> my 0.2 cents Vero El lun, 8 mar 2021 a las 11:37, Enrico Gabrielli bonushenricus (<bonushenricu...@gmail.com<mailto:bonushenricu...@gmail.com>>) escribió: Thanks some problems: > File "/home/bonushenricus/.grass7/addons/scripts/r.slope.d > irection.py", line 291, in <module> > options, flags = gscript.parser() > File "/usr/lib/grass76/etc/python/grass/script/core.py", > line 800, in parser > return _parse_opts(lines[1:]) > File "/usr/lib/grass76/etc/python/grass/script/core.py", > line 751, in _parse_opts > os.environ[var] = val > File "/usr/lib/python3.7/os.py", line 682, in __setitem__ > key = self.encodekey(key) > File "/usr/lib/python3.7/os.py", line 753, in encode > raise TypeError("str expected, not %s" % > type(value).__name__) > TypeError: str expected, not bytes It seems that the files are all there, but perhaps they must be updated. That's pity. Alternatively I will use MAPCALC with ABS (ATAN (TAN (slope) * COS (aspect - raster_direction))) but unfortunately with an extra passage and without the possibility of defining calculation steps. Il giorno lun, 08/03/2021 alle 09.04 +0000, Stefan Blumentrath ha scritto: > Hm, maybe some fixes for g.extension should be backported to 7.6... > > Anyway, as a workaround, you can just save the python script from (as > r.slope.direction > https://raw.githubusercontent.com/OSGeo/grass-addons/master/grass7/raster/r.slope.direction/r.slope.direction.py<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2FOSGeo%2Fgrass-addons%2Fmaster%2Fgrass7%2Fraster%2Fr.slope.direction%2Fr.slope.direction.py&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002815993017%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Z09e%2BMFUsYSqmqr%2F4GBoOiUmIJIPrrIk4L8FKXMISj8%3D&reserved=0> > ) to: > ~/.grass7/addons/scripts/ > > Then make it executable: > chmod u+x ~/.grass7/addons/scripts/r.slope.direction > > And it should work... > > Cheers > Stefan > > -----Original Message----- > From: Enrico Gabrielli bonushenricus > <bonushenricu...@gmail.com<mailto:bonushenricu...@gmail.com>> > Sent: mandag 8. mars 2021 09:44 > To: Stefan Blumentrath > <stefan.blumentr...@nina.no<mailto:stefan.blumentr...@nina.no>>; > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org> > Subject: Re: [GRASS-user] KEYLINE; installing new module add-on (of > 7.8) in GRASS 7.6 > > Hi Stefan > and thanks > Thanks to all and all developers! And here I have the answer directly > from those who have developed R-Slope.Direction, no ?? > Here's what happens: > > g.extension extension=r.slope.direction > > operation=add > > Fetching <r.slope.direction> from GRASS GIS Addons repository (be > > patient)... > > ERROR: Extension <r.slope.direction> not found > > Il giorno lun, 08/03/2021 alle 08.38 +0000, Stefan Blumentrath ha > scritto: > > Hi Enrico, > > > > GRASS 7.6 should not be a limiting factor. Did you try to install > > the > > addon through g.extension? > > > > g.extension extension=r.slope.direction operation=add > > > > If not, please try. If you did but get an error message, please > > provide the error message you got... > > > > Cheers > > Stefan > > > > > > -----Original Message----- > > From: grass-user > > <grass-user-boun...@lists.osgeo.org<mailto:grass-user-boun...@lists.osgeo.org>> > > On Behalf Of > > Enrico Gabrielli bonushenricus > > Sent: søndag 7. mars 2021 23:59 > > To: grass-ita...@listserv.unipr.it<mailto:grass-ita...@listserv.unipr.it>; > > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org> > > Subject: [GRASS-user] KEYLINE; installing new module add-on (of > > 7.8) > > in GRASS 7.6 > > > > Hello everyone and everyone. > > I write maybe once every one or two years! > > I am a geographer and agricultural consultant. > > I am using GRASS to design in KeyLine (you can easily find news > > about > > this ingenious technique, which is also the basis of permaculture, > > on > > the internet). > > I found that in GRASS 7.8 there is a new add-on module called > > r.slope.direction which would be very useful for keyline designs. > > Unfortunately I use Debian stable, and therefore GRASS 7.6. > > I have tried to use the r.slope.direction source script which I > > find > > here > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith > > ub.com<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fub.com%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816003012%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3Y9JbyLNHfAPDWE0dI4HJl%2FvcmaKKj%2BjwAHGxQsLbBY%3D&reserved=0>%2FOSGeo%2Fgrass- > > addons%2Ftree%2Fmaster%2Fgrass7%2Fraster%2Fr.sl > > ope.direction&data=04%7C01%7C%7C6f03009d912c4bed9a9e08d8e20e5a2 > > 0%7 > > C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507898555085492%7CUn > > kno > > wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haW > > wiL > > CJXVCI6Mn0%3D%7C1000&sdata=QpindTE6R0zQP6ArlP9rc2d3nFOYLMHhwtDn > > iM8 > > EksA%3D&reserved=0 but can't use it. If I install it following > > the > > instructions I find here > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgras > > swiki.osgeo.org<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fswiki.osgeo.org%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816003012%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=gk8N6pPObFTkozf0DPzZ4Hhpf1XmK0hZlGzPB6gxuZ4%3D&reserved=0>%2Fwiki%2FGRASS_and_Python%23Installation&data=0 > > 4%7 > > C01%7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b > > 3ab > > f02c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjo > > iMC > > 4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000& > > ;sd > > ata=1%2BzzVwsIW7mBcsBvuI%2Bvt2c7yULb%2B2oioSZCcAH1yUU%3D&reserv > > ed= > > 0 it gives me several errors. I created the directory in / usr / > > lib / > > grass76 / scripts / > > I can attach the result of the terminal. > > But if you think that it is simply not easy to install in GRASS 7.6 > > it > > will mean that I will be looking forward to Debian 11 (I never > > install > > testing) > > -- > > Perito agrario Enrico Gabrielli > > Tessera n. 633 Collegio Periti agrari prov. Di Modena Biblioteca > > agricoltura: > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww. > > zotero.org<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fzotero.org%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816013002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=2vRUp2qM7P1fsc5y3%2BY2v1PjJH168hvfZvXD8%2BkEVz8%3D&reserved=0>%2Fgroups%2Faplomb%2F&data=04%7C01%7C%7C6f03009d912c4 > > bed > > 9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C63750 > > 789 > > 8555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2lu > > MzI > > iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=kW8u9MG0ZAcaWy%2BW > > nII > > C%2F8KEZrchtuvGzZt0KegMGDg%3D&reserved=0 > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fit.l > > inkedin.com<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Finkedin.com%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816013002%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WZkdWG7QntG6EXS1D1GDMsYUM%2BLcV7dg1al0mfWvMFQ%3D&reserved=0>%2Fpub%2Fenrico- > > gabrielli%2F9a%2F186%2F159&data=04%7C01 > > %7C%7C6f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3ab > > f02 > > c73%7C0%7C0%7C637507898555085492%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC > > 4wL > > jAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sd > > ata > > =%2BudmXF9XutKPUBRmxCFM0J6Y1vUjy00sgNHxN4sea4Y%3D&reserved=0 > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fenri > > cogabrielli76.wordpress.com<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fcogabrielli76.wordpress.com%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816023000%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ak3nom1XUT983sxqzpHtdE3TIyTJ88F0d6q%2BFuUe3X4%3D&reserved=0>%2F&data=04%7C01%7C%7C6f03009d912c4b > > ed9 > > a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637507 > > 898 > > 555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM > > zIi > > LCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Ln9qjq1Zp3rZOOE9aGm > > GAs > > %2BLDMytIfH1QY6jYF%2FNjDg%3D&reserved=0 > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww. > > inaturalist.org<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Finaturalist.org%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816023000%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3P1qB%2BDIAZ54DxOJ%2Foj0BT4KBzuSKjaO1c%2FNKehqYGw%3D&reserved=0>%2Fobservations%2Fbonushenricus&data=04%7C01%7C% > > 7C6 > > f03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73% > > 7C0 > > %7C0%7C637507898555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwM > > DAi > > LCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jT5 > > gKt > > czQ1yxYVfm7eiUGlHFbzjUktUJFU6zynjGZPM%3D&reserved=0 > > skype: enricogabrielli > > (enricogabrielli76.per...@gmail.com<mailto:enricogabrielli76.per...@gmail.com>) > > > > _______________________________________________ > > grass-user mailing list > > grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org> > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist > > s.osgeo.org<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs.osgeo.org%2F&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816032994%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=3zAxmZrqievXcyexFuCyfCZs4jlVRmfeh%2FAqeVQRMCE%3D&reserved=0>%2Fmailman%2Flistinfo%2Fgrass- > > user&data=04%7C01%7C%7C6f > > 03009d912c4bed9a9e08d8e20e5a20%7C6cef373021314901831055b3abf02c73%7 > > C0% > > 7C0%7C637507898555095485%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMD > > AiL > > CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2Bh > > k3a > > uCu5tEI6v3nZBKwWPzrw%2F48XwetrtW9lEwTOj8%3D&reserved=0 _______________________________________________ grass-user mailing list grass-user@lists.osgeo.org<mailto:grass-user@lists.osgeo.org> https://lists.osgeo.org/mailman/listinfo/grass-user<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgrass-user&data=04%7C01%7C%7C632b2fcb438f41f2524508d8e2269f43%7C6cef373021314901831055b3abf02c73%7C0%7C0%7C637508002816032994%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=qNlrRsTnQOB0SMqvr5y6W%2FbAnRn2NSrOci5%2FPsHTVmM%3D&reserved=0>
_______________________________________________ grass-user mailing list grass-user@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-user