Comments (19)
I suppose it is an addon bug since other addons can be installed.
The replacement of python
with python3
is needed in g.extension
.
from grass-addons.
My estimation is, that the is some "strange character" in the input file, so that replace fails. Maybe replacing just the first line would help. This can occur in any future extension
Also, if on non-Linux platform (aka windows), the replacement is not necessary, since Windows ignore it, right?
from grass-addons.
My estimation is, that the is some "strange character" in the input file, so that replace fails. Maybe replacing just the first line would help. This can occur in any future extension
Yes it is. Lambda symbol and others. fileinput.FileInput()
method open file with default OS system encoding. It is possible define openhook
param arg (using the given encoding), but not with inplace=True
param arg. On GNU/Linux, I did not notice any problem with the installation of the r.green extension.
Also, if on non-Linux platform (aka windows), the replacement is not necessary, since Windows ignore it, right?
from grass-addons.
Shall we replace those "offending" symbols in r.green
or modify anything else? Any suggestion, @zarch ?
from grass-addons.
If commented out in g.extension (as mentioned above), r.green module installation work:
# for filename in pyfiles:
# with fileinput.FileInput(filename, inplace=True) as file:
# for line in file:
# print(line.replace(
# "#!/usr/bin/env python\n",
# "#!/usr/bin/env python3\n"
# ), end='')
But rendering special symbol in module ui is incorrect on MS WIndows (wxMSW).
r.green.gshp.technical module ui, OS MS Windows (wxMSW)
wxPython use default encoding (according locale):
import wx
locale = wx.Locale()
locale.GetSystemEncodingName()
windows-1252
Lambda symbol is UTF-8.
r.green.gshp.technical module ui, OS GNU/Linux (wxGTK)
wxPython use default encoding (according locale):
import wx
locale = wx.Locale()
locale.GetSystemEncodingName()
UTF-8
I think it would be appropriate to replace these special symbols.
from grass-addons.
Any suggestion how to deal with this?
from grass-addons.
hello, i encountered similar issue when installing r.green addons, and no issue on installing other addons. i'm using grass 7.8.3 on windows. any help to solve this issue? I saw
If commented out in g.extension (as mentioned above), r.green module installation work:
# for filename in pyfiles: # with fileinput.FileInput(filename, inplace=True) as file: # for line in file: # print(line.replace( # "#!/usr/bin/env python\n", # "#!/usr/bin/env python3\n" # ), end='')
But rendering special symbol in module ui is incorrect on MS WIndows (wxMSW).
r.green.gshp.technical module ui, OS MS Windows (wxMSW)
r.green.gshp.technical module ui, OS GNU/Linux (wxGTK)
I think it would be appropriate to replace these special symbols.
How do we put this on command console? after the error message?
from grass-addons.
hello, i encountered similar issue when installing r.green addons, and no issue on installing other addons. i'm using grass 7.8.3 on windows. any help to solve this issue? I saw
How do we put this on command console? after the error message?
Hello, here's how to install r.green Add-On (OS MS Windows, WIn GRASS GIS 7.8.3 installation).
- Launch your favourite text editor (Notepad++...) with Admin rights.
- Open in text editor this file C:\Program Files\GRASS GIS 7.8\scripts\g.extension.py
- Go to line code
1148 comment this lines (1148-1154 including):when you find this uncommented code (code bellow in the install_extension_win() function) and comment them (according code below):
# for filename in pyfiles:
# with fileinput.FileInput(filename, inplace=True) as file:
# for line in file:
# print(line.replace(
# "#!/usr/bin/env python\n",
# "#!/usr/bin/env python3\n"
# ), end='')
- Save edited file
- Install r.green Add-On with command:
g.extension r.green
or via GUI - Try launch some r.green module e.g.
r.green.gshp.technical
from grass-addons.
hello @tmszi thank you very much for the response!
I did exactly as you said however it still doesnt work out
below is the edited g.extension py
and the same error message once i try to install the r.green
from grass-addons.
hello @tmszi thank you very much for the response!
I did exactly as you said however it still doesnt work out
below is the edited g.extension py
and the same error message once i try to install the r.green
I think you have another GRASS GIS version than I have and therefore line numbers (step no. 3 in my previous message) aren't correct.
According screenshot with error you send go to line 1055, and you will see this code:
for filename in pyfiles:
with fileinput.FileInput(filename, inplace=True) as file:
for line in file:
print(line.replace(
"#!/usr/bin/env python\n",
"#!/usr/bin/env python3\n"
), end='')
and comment this lines (add # comment symbol before these lines)
# for filename in pyfiles:
# with fileinput.FileInput(filename, inplace=True) as file:
# for line in file:
# print(line.replace(
# "#!/usr/bin/env python\n",
# "#!/usr/bin/env python3\n"
# ), end='')
from grass-addons.
it works perfectly now! thanks a lot @tmszi
from grass-addons.
it works perfectly now! thanks a lot @tmszi
You are welcome :-).
from grass-addons.
hi @tmszi and all,
I have managed to install the r.green addon and run some modules. However when i tried to run the r.green.hydro.optimal, error message on the scipy requirement appeared:
WARNING: You should install scipy to use this module: pip install scipy
WARNING: You should install scipy to use this module: pip install scipy
WARNING: You should install scipy to use this module: pip install scipy
WARNING: You should install scipy to use this module: pip install scipy
Traceback (most recent call last):
File "C:\Users\ANIA\AppData\Roaming\GRASS7\addons/scripts/
r.green.hydro.optimal.py", line 189, in
sys.exit(main(options, flags))
File "C:\Users\ANIA\AppData\Roaming\GRASS7\addons/scripts/
r.green.hydro.optimal.py", line 180, in main
p_max)
File "C:\Users\ANIA\AppData\Roaming\GRASS7\addons\etc\r.gr
een\libhydro\optimal.py", line 357, in find_segments
count, p_max)
File "C:\Users\ANIA\AppData\Roaming\GRASS7\addons\etc\r.gr
een\libhydro\optimal.py", line 231, in recursive_plant
cat, line, count, p_max)
File "C:\Users\ANIA\AppData\Roaming\GRASS7\addons\etc\r.gr
een\libhydro\optimal.py", line 243, in check_plant
fun_h = interpolate.interp1d(prog, h,
bounds_error=False, fill_value=0)
NameError: name 'interpolate' is not defined
(Tue Oct 13 11:46:33 2020) Command finished (1 sec)
I have installed scipy and numpy as required and it shown in the command below:
Appreciate it very much if anyone could help me on this matter. I have very little to none knowledge on python
from grass-addons.
from grass-addons.
hi @baharmon i did exactly as you said and the same error message still appear.
WARNING: You should install scipy to use this module: pip install scipy
WARNING: You should install scipy to use this module: pip install scipy
Is there a way to check of whether scipy is properly installed and detected by Grass?
from grass-addons.
I already tried to check in Grass terminal btw, and it says that I have scipy. Unsure why this warning message appears :(
from grass-addons.
hi @tmszi and all,
I have managed to install the r.green addon and run some modules. However when i tried to run the r.green.hydro.optimal, error message on the scipy requirement appeared:
Hi anissa293, here's how to install python additional scipy lib (OS MS Windows, Standalone Win GRASS GIS 7.8 installation). I tested on 64 bit OS Win 10, with Standalone GRASS GIS 64 bit installer.
-
Download numpy and scipy windows binary package from this page Unofficial Windows Binaries for Python Extension Packages.
Choose between 32/64 bit according your GRASS GIS installation.
1.1 64 bit GRASS GIS version: numpy, scipy
1.2 32 bit GRASS GIS version: numpy, scipy -
GRASS GIS is distributed with own Python version. First launch new cmd (command line program) with Admin rights. Change dir with following command in cmd:
cd "C:\Program Files\GRASS GIS 7.8\Python37"
- Install numpy python bin lib first with following command in the cmd:
Change PATH_TO_DOWNLOADED_NUMPY_WHL_FILE
to the right path (my path is e.g. C:\Users\IEUser\Desktop\numpy-1.18.5+mkl-cp37-cp37m-win_amd64.whl)
python.exe Scripts\pip3.exe install PATH_TO_DOWNLOADED_NUMPY_WHL_FILE
- Install scipy python bin lib with following command in the cmd:
Change PATH_TO_DOWNLOADED_SCIPY_WHL_FILE
to the right path (my path is e.g. C:\Users\IEUser\Desktop\scipy-1.4.1-cp37-cp37m-win_amd64.whl)
python.exe Scripts\pip3.exe install PATH_TO_DOWNLOADED_SCIPY_WHL_FILE
- Launch GRASS GIS and r.green module
r.green.hydro.optimal
from grass-addons.
I already tried to check in Grass terminal btw, and it says that I have scipy. Unsure why this warning message appears :(
If you want verify that GRASS GIS Python has scipy lib installed (GRASS GIS has own Python in the installation directory: C:\Program Files\GRASS GIS 7.8\Python37) :
- Launch cmd
- Change dir in cmd
cd "C:\Program Files\GRASS GIS 7.8\Python37"
- Get list of installed Python libs
python.exe Scripts\pip3.exe freeze list
Or simple way via GUI Python shell (Layer Manager -> Python tab)
import scipy
(run without error)
from grass-addons.
Hi anissa293, here's how to install python additional scipy lib (OS MS Windows, Standalone Win GRASS GIS 7.8 installation). I tested on 64 bit OS Win 10, with Standalone GRASS GIS 64 bit installer.
hi @tmszi it finally works! thanks a lot for this. I also checked again the scipy lib in Grass Python is installed. Hopefully no more issues after this fingercrossed
from grass-addons.
Related Issues (20)
- [Bug] i.fusion.hpf can longer be installed with g.extension HOT 5
- v.db.pyupdate warning during installation
- [Feat] i.sentinel.import: handle processing baselines HOT 3
- [Bug] Add concurrency groups/cancel in progress for skipping outdated CI runs
- Add tests to i.modis, i.landsat, i.sentinel download HOT 23
- Addons for plotting: Standardize parameters and flags HOT 3
- [Bug] r.accumulate segfaults without specifying accumulation_type
- r.landscape.evol: Incorrect number of seconds in a day HOT 1
- [Bug] r.connectivity.distance error HOT 1
- [Bug] g.extension uses wrong path HOT 3
- Remove master branch HOT 1
- docs: wrong URI in SUBMITTING HOT 1
- [Bug] v.in.natura2000: update input data format from spatialite to geopackage
- v.rast.move: empty keywords break addon overview script HOT 2
- [Bug] i.sentinel.download: give warning instead of errors if single files are corrupt
- v.surf.mass: Input should be vector "area" map? HOT 1
- [Bug] testsuite: do not run tests for deprecated module HOT 4
- [Bug] m.tnm.download and m.cdo.download fail to build on Windows server due to using external Python library requests
- r.stream.distance elevations with value of -1 [Bug]
- [Bug] Remove r.sim.water.mp from addons
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grass-addons.