[GRASS-user] Running a python script using GRASS GIS on a Mac

2021-12-20 Thread Nicklas Larsson via grass-user
Shaffiq,
To install grass-session to the embedded Python with the GRASS mac app bundle, 
try in a GRASS terminal:

/Applications/GRASS-7.8.app/Contents/Resources/bin/python -m pip install 
--upgrade pip
/Applications/GRASS-7.8.app/Contents/Resources/bin/python -m pip install 
grass-session 
Best,Nicklas
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


[GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Nicklas Larsson via grass-user

Following might work (from  a GRASS 
terminal):/Applications/GRASS-7.8.app/Contents/Resources/bin/python -m pip pip 
install --upgrade pip/Applications/GRASS-7.8.app/Contents/Resources/bin/python 
-m pip pip install pandas 



Unfortunately, at the moment I can’t test this.




Best, Nicklas
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread dheerajchand.com
Here's what I'm seeing in the GRASS that I just installed from the same 
installer.  The commands at the terminal show me:

1. The location of the python being executed
2. The location of the pip being executed
3. Which error happens when I try to install pandas
4. Changing the shell to zsh
5. Checking whether that changed the python available
6. Error when I try to install pandas

As I suspected, the application Python is not able to use pip install to 
install pandas.  The next step is to determine how to 

1) change the Python that builds with GRASS
2) give that Python access to the system framework libraries that allow things 
to build

If it's feasible, the easiest way to use OSGEO things on Mac is with Docker 
containers. Does that help at all?

Dheeraj


GRASS 7.8.6 (test):~ > which python
/Applications/GRASS-7.8.app/Contents/Resources/bin/python
GRASS 7.8.6 (test):~ > which pip
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip
GRASS 7.8.6 (test):~ > pip install pandas
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 4: import: command 
not found
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 5: import: command 
not found
from: can't read /var/mail/pip._internal.cli.main
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 10: syntax error 
near unexpected token `('
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 10: `
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'
GRASS 7.8.6 (test):~ > echo $SHELL
/bin/bash
GRASS 7.8.6 (test):~ > chsh -s /usr/local/bin/zsh
Changing shell for dheerajchand.
Password for dheerajchand: 
chsh: Credentials could not be verified, username or password is invalid.  
Credentials could not be verified, username or password is invalid.
GRASS 7.8.6 (test):~ > chsh -s /usr/local/bin/zsh
Changing shell for dheerajchand.
Password for dheerajchand: 
chsh: /usr/local/bin/zsh: non-standard shell
GRASS 7.8.6 (test):~ > which python
/Applications/GRASS-7.8.app/Contents/Resources/bin/python
GRASS 7.8.6 (test):~ > pip install pandas
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 4: import: command 
not found
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 5: import: command 
not found
from: can't read /var/mail/pip._internal.cli.main
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 10: syntax error 
near unexpected token `('
/Applications/GRASS-7.8.app/Contents/Resources/bin/pip: line 10: `
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])'
GRASS 7.8.6 (test):~ > 

> On Dec 20, 2021, at 8:20 AM, Dheeraj Chand  wrote:
> 
> Let me try this when I get to my desk. My suspicion is that the Python that 
> GRASS is using does not have Pandas and that the path inside the 
> self-contained binary’s terminal does not easily give you access to the 
> foundation libraries you’ll need to install it. 
> 
> Let me check and let you know. 
> 
> Sent from my iPhone
> 
>> On Dec 20, 2021, at 7:57 AM, Gioia Blayer  
>> wrote:
>> 
>> 
>> Thank you all for the reply and help,
>> 
>> Veronica - I tried according to the link sent but unfortunately it still 
>> doesn't work.
>> 
>> Dheeraj - I downloaded GRASS GIS 7.8.6 from the link on the website 
>> https://grass.osgeo.org/download/mac/ 
>>  and followed the instructions given. 
>> Is this what you meant?
>> 
>> Overall I am able to install Add-ons, it's just with the add-ons that depend 
>> on python packages (like r.area.createweight that depends on pandas and 
>> scikit-learn) that I have difficulty in installing the relevant packages in 
>> GRASS GIS python environment. Maybe I'm missing something - I will try to 
>> remove and re-install the program from scratch.
>> 
>> Thanks again!
>> 
>> 
>> On Mon, Dec 20, 2021 at 3:19 PM Dheeraj Chand > > wrote:
>> This may also depend on how you have built GRASS on Mac. There are a few 
>> ways to do it, all of which are a big pain! Which technique did you use?
>> 
>> Sent from my iPhone
>> 
>>> On Dec 20, 2021, at 5:42 AM, Veronica Andreo >> > wrote:
>>> 
>>> 
>>> Hi Gioia,
>>> 
>>> Have you tried with `pip3 install pandas` in the terminal? I guess the 
>>> pandas you use within pycharm is in a virtualenv or so, and grass might not 
>>> have access to it. I do not use Mac but I found this: 
>>> https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/ 
>>> 
>>> 
>>> hope that helps
>>> Vero
>>> 
>>> El dom, 19 dic 2021 a las 15:33, Gioia Blayer 
>>> (mailto:gioia.bla...@mail.huji.ac.il>>) 
>>> escribió:
>>> Hello everyone, 
>>> 
>>> I am trying to install the module r.area.createweight in GRASS GIS version 
>>> 7.8.6 on macOS Monterey 12.1. When I run the command g.extension 
>>> r.area.createweight from the console in GRASS GIS I get the following error:
>>> 
>>> Fetching  from GRASS GIS Addons 

Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Dheeraj Chand
Let me try this when I get to my desk. My suspicion is that the Python that 
GRASS is using does not have Pandas and that the path inside the self-contained 
binary’s terminal does not easily give you access to the foundation libraries 
you’ll need to install it. 

Let me check and let you know. 

Sent from my iPhone

> On Dec 20, 2021, at 7:57 AM, Gioia Blayer  
> wrote:
> 
> 
> Thank you all for the reply and help,
> 
> Veronica - I tried according to the link sent but unfortunately it still 
> doesn't work.
> 
> Dheeraj - I downloaded GRASS GIS 7.8.6 from the link on the website 
> https://grass.osgeo.org/download/mac/ and followed the instructions given. Is 
> this what you meant?
> 
> Overall I am able to install Add-ons, it's just with the add-ons that depend 
> on python packages (like r.area.createweight that depends on pandas and 
> scikit-learn) that I have difficulty in installing the relevant packages in 
> GRASS GIS python environment. Maybe I'm missing something - I will try to 
> remove and re-install the program from scratch.
> 
> Thanks again!
> 
> 
>> On Mon, Dec 20, 2021 at 3:19 PM Dheeraj Chand  
>> wrote:
>> This may also depend on how you have built GRASS on Mac. There are a few 
>> ways to do it, all of which are a big pain! Which technique did you use?
>> 
>> Sent from my iPhone
>> 
 On Dec 20, 2021, at 5:42 AM, Veronica Andreo  wrote:
 
>>> 
>>> Hi Gioia,
>>> 
>>> Have you tried with `pip3 install pandas` in the terminal? I guess the 
>>> pandas you use within pycharm is in a virtualenv or so, and grass might not 
>>> have access to it. I do not use Mac but I found this: 
>>> https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/
>>> 
>>> hope that helps
>>> Vero
>>> 
 El dom, 19 dic 2021 a las 15:33, Gioia Blayer 
 () escribió:
 Hello everyone, 
 
 I am trying to install the module r.area.createweight in GRASS GIS version 
 7.8.6 on macOS Monterey 12.1. When I run the command g.extension 
 r.area.createweight from the console in GRASS GIS I get the following 
 error:
 
 Fetching  from GRASS GIS Addons repository (be 
 patient)...
 ERROR: Pandas is not installed
 Compiling...
 [make: *** [r.area.createweight.tmp.html] Error 1
 ERROR: Compilation failed, sorry. Please check the above error messages.
 
 I do have Pandas because I use it for python in pycharm, but I do not 
 understand how to install Pandas in the GRASS GIS environment. 
 Hope someone can help me with this, I feel it's something quick and 
 technical but I'm new to grass gis, so it takes me some time to learn it.
 
 Thank you in advance for the time and help!
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 https://lists.osgeo.org/mailman/listinfo/grass-user
>>> ___
>>> grass-user mailing list
>>> grass-user@lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Gioia Blayer
Thank you Dheeraj! Sure, let me know how it goes.

Gioia


On Mon, 20 Dec 2021, 16:20 Dheeraj Chand,  wrote:

> Let me try this when I get to my desk. My suspicion is that the Python
> that GRASS is using does not have Pandas and that the path inside the
> self-contained binary’s terminal does not easily give you access to the
> foundation libraries you’ll need to install it.
>
> Let me check and let you know.
>
> Sent from my iPhone
>
> On Dec 20, 2021, at 7:57 AM, Gioia Blayer 
> wrote:
>
> 
> Thank you all for the reply and help,
>
> Veronica - I tried according to the link sent but unfortunately it still
> doesn't work.
>
> Dheeraj - I downloaded GRASS GIS 7.8.6 from the link on the website
> https://grass.osgeo.org/download/mac/ and followed the instructions
> given. Is this what you meant?
>
> Overall I am able to install Add-ons, it's just with the add-ons that
> depend on python packages (like r.area.createweight that depends on pandas
> and scikit-learn) that I have difficulty in installing the relevant
> packages in GRASS GIS python environment. Maybe I'm missing something - I
> will try to remove and re-install the program from scratch.
>
> Thanks again!
>
>
> On Mon, Dec 20, 2021 at 3:19 PM Dheeraj Chand 
> wrote:
>
>> This may also depend on how you have built GRASS on Mac. There are a few
>> ways to do it, all of which are a big pain! Which technique did you use?
>>
>> Sent from my iPhone
>>
>> On Dec 20, 2021, at 5:42 AM, Veronica Andreo 
>> wrote:
>>
>> 
>> Hi Gioia,
>>
>> Have you tried with `pip3 install pandas` in the terminal? I guess the
>> pandas you use within pycharm is in a virtualenv or so, and grass might not
>> have access to it. I do not use Mac but I found this:
>> https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/
>>
>> hope that helps
>> Vero
>>
>> El dom, 19 dic 2021 a las 15:33, Gioia Blayer (<
>> gioia.bla...@mail.huji.ac.il>) escribió:
>>
>>> Hello everyone,
>>>
>>> I am trying to install the module r.area.createweight in GRASS GIS
>>> version 7.8.6 on macOS Monterey 12.1. When I run the command g.extension
>>> r.area.createweight from the console in GRASS GIS I get the following
>>> error:
>>>
>>> Fetching  from GRASS GIS Addons repository (be
>>> patient)...
>>> ERROR: Pandas is not installed
>>> Compiling...
>>> [make: *** [r.area.createweight.tmp.html] Error 1
>>> ERROR: Compilation failed, sorry. Please check the above error messages.
>>>
>>> I do have Pandas because I use it for python in pycharm, but I do not
>>> understand how to install Pandas in the GRASS GIS environment.
>>> Hope someone can help me with this, I feel it's something quick and
>>> technical but I'm new to grass gis, so it takes me some time to learn
>>> it.
>>>
>>> Thank you in advance for the time and help!
>>> ___
>>> grass-user mailing list
>>> grass-user@lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Gioia Blayer
Thank you all for the reply and help,

Veronica - I tried according to the link sent but unfortunately it still
doesn't work.

Dheeraj - I downloaded GRASS GIS 7.8.6 from the link on the website
https://grass.osgeo.org/download/mac/ and followed the instructions given.
Is this what you meant?

Overall I am able to install Add-ons, it's just with the add-ons that
depend on python packages (like r.area.createweight that depends on pandas
and scikit-learn) that I have difficulty in installing the relevant
packages in GRASS GIS python environment. Maybe I'm missing something - I
will try to remove and re-install the program from scratch.

Thanks again!


On Mon, Dec 20, 2021 at 3:19 PM Dheeraj Chand 
wrote:

> This may also depend on how you have built GRASS on Mac. There are a few
> ways to do it, all of which are a big pain! Which technique did you use?
>
> Sent from my iPhone
>
> On Dec 20, 2021, at 5:42 AM, Veronica Andreo  wrote:
>
> 
> Hi Gioia,
>
> Have you tried with `pip3 install pandas` in the terminal? I guess the
> pandas you use within pycharm is in a virtualenv or so, and grass might not
> have access to it. I do not use Mac but I found this:
> https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/
>
> hope that helps
> Vero
>
> El dom, 19 dic 2021 a las 15:33, Gioia Blayer (<
> gioia.bla...@mail.huji.ac.il>) escribió:
>
>> Hello everyone,
>>
>> I am trying to install the module r.area.createweight in GRASS GIS
>> version 7.8.6 on macOS Monterey 12.1. When I run the command g.extension
>> r.area.createweight from the console in GRASS GIS I get the following
>> error:
>>
>> Fetching  from GRASS GIS Addons repository (be
>> patient)...
>> ERROR: Pandas is not installed
>> Compiling...
>> [make: *** [r.area.createweight.tmp.html] Error 1
>> ERROR: Compilation failed, sorry. Please check the above error messages.
>>
>> I do have Pandas because I use it for python in pycharm, but I do not
>> understand how to install Pandas in the GRASS GIS environment.
>> Hope someone can help me with this, I feel it's something quick and
>> technical but I'm new to grass gis, so it takes me some time to learn it.
>>
>> Thank you in advance for the time and help!
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Dheeraj Chand
This may also depend on how you have built GRASS on Mac. There are a few ways 
to do it, all of which are a big pain! Which technique did you use?

Sent from my iPhone

> On Dec 20, 2021, at 5:42 AM, Veronica Andreo  wrote:
> 
> 
> Hi Gioia,
> 
> Have you tried with `pip3 install pandas` in the terminal? I guess the pandas 
> you use within pycharm is in a virtualenv or so, and grass might not have 
> access to it. I do not use Mac but I found this: 
> https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/
> 
> hope that helps
> Vero
> 
>> El dom, 19 dic 2021 a las 15:33, Gioia Blayer 
>> () escribió:
>> Hello everyone, 
>> 
>> I am trying to install the module r.area.createweight in GRASS GIS version 
>> 7.8.6 on macOS Monterey 12.1. When I run the command g.extension 
>> r.area.createweight from the console in GRASS GIS I get the following error:
>> 
>> Fetching  from GRASS GIS Addons repository (be 
>> patient)...
>> ERROR: Pandas is not installed
>> Compiling...
>> [make: *** [r.area.createweight.tmp.html] Error 1
>> ERROR: Compilation failed, sorry. Please check the above error messages.
>> 
>> I do have Pandas because I use it for python in pycharm, but I do not 
>> understand how to install Pandas in the GRASS GIS environment. 
>> Hope someone can help me with this, I feel it's something quick and 
>> technical but I'm new to grass gis, so it takes me some time to learn it.
>> 
>> Thank you in advance for the time and help!
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] Pandas installation in GRASS GIS environment

2021-12-20 Thread Veronica Andreo
Hi Gioia,

Have you tried with `pip3 install pandas` in the terminal? I guess the
pandas you use within pycharm is in a virtualenv or so, and grass might not
have access to it. I do not use Mac but I found this:
https://www.geeksforgeeks.org/how-to-install-python-pandas-on-macos/

hope that helps
Vero

El dom, 19 dic 2021 a las 15:33, Gioia Blayer ()
escribió:

> Hello everyone,
>
> I am trying to install the module r.area.createweight in GRASS GIS
> version 7.8.6 on macOS Monterey 12.1. When I run the command g.extension
> r.area.createweight from the console in GRASS GIS I get the following
> error:
>
> Fetching  from GRASS GIS Addons repository (be
> patient)...
> ERROR: Pandas is not installed
> Compiling...
> [make: *** [r.area.createweight.tmp.html] Error 1
> ERROR: Compilation failed, sorry. Please check the above error messages.
>
> I do have Pandas because I use it for python in pycharm, but I do not
> understand how to install Pandas in the GRASS GIS environment.
> Hope someone can help me with this, I feel it's something quick and
> technical but I'm new to grass gis, so it takes me some time to learn it.
>
> Thank you in advance for the time and help!
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user
>
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user


Re: [GRASS-user] how to derive polygons from text strings

2021-12-20 Thread Uwe Fischer
Hello Māris,

thanks a lot. That is hard tobacco for a user like me. What do you mean 'ask 
the same rendering engine'?
Is there a chance to get such boxes for a normal user or is it a case for a c++ 
programmer?

Mit freundlichen Grüßen,
UWE FISCHER

--

Ingenieurbüro Fischer
Esbecker Str. 8
31036 Eime
Tel.: 05182/8325
Mobil: 0172/8876934


-Ursprüngliche Nachricht-
Von: Maris Nartiss [mailto:maris@gmail.com] 
Gesendet: Montag, 20. Dezember 2021 08:25
An: Uwe Fischer 
Cc: GRASS user list 
Betreff: Re: [GRASS-user] how to derive polygons from text strings

AFIAK no*

It is more tricky than it might seem as exact dimensions depend not only on 
font size but also on selected font (see monospace vs condensed fonts), 
kerning, styling (bold, italics). Thus final size of bonding box of a string is 
a product of all of its properties. Thus the best option to get the size right 
is to ask the same rendering engine to calculate exact dimensions as it will 
know the size it will use.


* apart from one used for vector labelling in d.* modules, but that is not 
exposed to the enduser. See D_get_text_box from display library.

Māris.

sestd., 2021. g. 18. dec., plkst. 18:50 — lietotājs Uwe Fischer
() rakstīja:
>
> Hello list,
>
> I have a point feature layer with attributes for a text string (call it 
> 'label') and the fontsize in map units (which are meters in my case). Is 
> there a way in Grass to derive polygons from this input information which 
> enclose the label strings  when those are used to label the points? For those 
> who know ArcMap: what I mean is exactly what happens when you save 
> Annotations as Shapes in ArcCatalog: you get a polygon layer in which each 
> text string has a polygon hull which fits the height and width, respectively.
>
> best regards,
>
> Uwe
>
> ___
> grass-user mailing list
> grass-user@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-user

___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user