OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 111 forks source link

GRASS window pops up when starting qgis3 #436

Closed nextstopsun closed 6 years ago

nextstopsun commented 6 years ago

When starting qgis3 a grass welcome window pops up. Same as in https://github.com/OSGeo/homebrew-osgeo4mac/pull/429

fjperini commented 6 years ago

@luisspuerto It's done! You tell me how it turned out.

nextstopsun commented 6 years ago

@fjperini Why can't head point to current master instead of revision? Won't it build?

fjperini commented 6 years ago

@nextstopsun because I thought it best to use until the revision that I used. Since master changes every day. Let's use this until the new version is published. But you can try only with master.

luispuerto commented 6 years ago

@nextstopsun didn't build for me before... but I was using the wrong formula.

@fjperini the window it's a little bit... pesky. kapture 2018-08-11 at 18 03 59

It pop up what you click in a grass script in the toolbox. It didn't pop up previously and definitely doesn't pop up in QGIS2.

But... As far as I understood the problem isn't the qgis3 formula but qgis software itself, is it? so... is this problem just present in 3.2.1 version? perhaps in 3.2 isn't present.

fjperini commented 6 years ago

@luisspuerto It seems that you need the GRASS session to be started.

Yes, I think the problem is that of software. It would be necessary to report this to the developers @nyalldawson

luispuerto commented 6 years ago

@fjperini I can try to install 3.2 and see if the window pop up...

fjperini commented 6 years ago

@luisspuerto I will use version 3.2.0, to check if it works well. 😂 telepathy

luispuerto commented 6 years ago

LOL @fjperini 😂

PS/ I'll probably try to build it later.

fjperini commented 6 years ago

@luisspuerto Ok! I'm already doing it.

fjperini commented 6 years ago

@luisspuerto this is interesting, given that the build_1 works correctly.

qgis3-b1

I will try some things!

luispuerto commented 6 years ago

@fjperini is that 3.2.0?

fjperini commented 6 years ago

@luisspuerto No, v3.2.1. It's the first build I made. I'm reviewing some things. We are corralling the solution. Ha!

fjperini commented 6 years ago

@luisspuerto I found some things that must be changed. I hope that is what is causing the problem.

luispuerto commented 6 years ago

I've tried to build 3.0.3 with the last formula and it failed.

luispuerto commented 6 years ago

What we really need to find out is if the pop up window is due to:

nyalldawson commented 6 years ago

For reference: this doesn't happen on any other builds, including the (semi) official OSX qgis packages.

luispuerto commented 6 years ago

@nyalldawson thanks for let us know... It's probably something related to qgis3 formula or grass one.

fjperini commented 6 years ago

@luisspuerto The problem with v3.0.3, is that you need a patch.

+#include <QDoubleValidator>
+#include <QIntValidator>

Let's use v3.2.1.

fjperini commented 6 years ago

@luisspuerto I'm using the old version of the formula. I will add little by little all the changes that were made. To see if there is an error in the formula.

fjperini commented 6 years ago

@luisspuerto @nextstopsun @nickrobison Good news! 🎉
I have built and everything works very well. I will continue to add the changes I made until I find what caused the problem.

fjperini commented 6 years ago

@luisspuerto @nextstopsun Solved! 🎉

luispuerto commented 6 years ago

I'll try it... did you solved with head or with 3.2.1 release?

fjperini commented 6 years ago

Yes, you can see the pull: formula.

luispuerto commented 6 years ago

I just pull it to my computer and I'm building right now 🙂

luispuerto commented 6 years ago

Built and no grass window 🎉

However, this was printed in the shell at the end:

GRASS 7 GrassUtils.py has been updated
Warning: osgeo/osgeo4mac/qgis3 dependency gcc was built with a different C++ standard
library (libstdc++ from clang). This may cause problems at runtime.
GRASS 7 GrassUtils.py already updated
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'future'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'jinja2'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pygments'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'psycopg2'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'requests'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'future'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'jinja2'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pygments'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt'

Weird, because I have all those modules.

pip install psycopg2 matplotlib pyparsing requests future jinja2 pygments                12:01:24  13.08.18
Requirement already satisfied: psycopg2 in /usr/local/lib/python2.7/site-packages (2.7.5)
Requirement already satisfied: matplotlib in /usr/local/lib/python2.7/site-packages (2.2.2)
Requirement already satisfied: pyparsing in /usr/local/lib/python2.7/site-packages (2.2.0)
Requirement already satisfied: requests in /usr/local/lib/python2.7/site-packages (2.19.1)
Requirement already satisfied: future in /usr/local/lib/python2.7/site-packages (0.16.0)
Requirement already satisfied: jinja2 in /usr/local/lib/python2.7/site-packages (2.10)
Requirement already satisfied: pygments in /usr/local/lib/python2.7/site-packages (2.2.0)
Requirement already satisfied: backports.functools-lru-cache in /usr/local/lib/python2.7/site-packages (from matplotlib) (1.5)
Requirement already satisfied: subprocess32 in /usr/local/lib/python2.7/site-packages (from matplotlib) (3.5.2)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/site-packages (from matplotlib) (2018.5)
Requirement already satisfied: six>=1.10 in /usr/local/lib/python2.7/site-packages (from matplotlib) (1.11.0)
Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python2.7/site-packages (from matplotlib) (2.7.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python2.7/site-packages (from matplotlib) (1.0.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python2.7/site-packages (from matplotlib) (0.10.0)
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python2.7/site-packages (from matplotlib) (1.15.0)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python2.7/site-packages (from requests) (2018.4.16)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /usr/local/lib/python2.7/site-packages (from requests) (3.0.4)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in /usr/local/lib/python2.7/site-packages (from requests) (1.23)
Requirement already satisfied: idna<2.8,>=2.5 in /usr/local/lib/python2.7/site-packages (from requests) (2.7)
Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python2.7/site-packages (from jinja2) (1.0)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages (from kiwisolver>=1.0.1->matplotlib) (39.2.0)
luispuerto commented 6 years ago

PS/ now I miss the window hahahaahahahaha 😂

fjperini commented 6 years ago

@luisspuerto I'll check that! Possibly because I changed a path.

luispuerto commented 6 years ago

Great work @fjperini 👍

nextstopsun commented 6 years ago

@fjperini Checked and GRASS window is gone. You're the man! Should we close this one?

fjperini commented 6 years ago

@nextstopsun yes, later I check the message of the modules.

fjperini commented 6 years ago

@luisspuerto @nextstopsun Can you confirm that everything works correctly? I'm reviewing, it seems just a verification message, possibly look elsewhere for those modules. The modules are installed, so QGIS should work well.

fjperini commented 6 years ago

I have solved the message problem of the modules. Later I apply the changes.

luispuerto commented 6 years ago

Great! @fjperini

Do you think they're affecting the functionality of the app?

Perhaps something is still going on with grass:

Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!

PYTHONPATH is currently: "/usr/local/opt/gdal2-python/lib/python3.7/site-packages:/usr/local/opt/qgis3/lib/python3.7/site-packages:/usr/local/opt/qgis3/libexec/python/lib/python3.7/site-packages:/usr/local/lib/python3.7/site-packages"

You should `unset PYTHONPATH` to fix this.

Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!

PYTHONPATH is currently: "/usr/local/opt/gdal2-python/lib/python3.7/site-packages:/usr/local/opt/qgis3/lib/python3.7/site-packages:/usr/local/opt/qgis3/libexec/python/lib/python3.7/site-packages:/usr/local/lib/python3.7/site-packages"

You should `unset PYTHONPATH` to fix this.

error while executing a script

PS/ they doesn't happen in qgis2

luispuerto commented 6 years ago

for sure I'm using python3 ... but grass seems to not recognize it

screen shot 2018-08-13 at 23 38 13

fjperini commented 6 years ago

@luisspuerto Good information. I'm working on it. It may be necessary to build GRASS with (formula) python3? It is currently built with python2.

luispuerto commented 6 years ago

@fjperini I'm not sure... seems that grass7 still needs python2 to work. Perhaps another option is introduce in the qgis3 PYTHONPATH the path for python2 libraries.

luispuerto commented 6 years ago

PS/ When you download the official build for mac you only need to install python3. Right now you need to install python3.6 instead of the newest 3.7 as far as I know.

luispuerto commented 6 years ago

@fjperini perhaps grass needs to be build on python3 for qgis3 https://grasswiki.osgeo.org/wiki/Compiling_on_MacOSX_using_homebrew I don't really know.

luispuerto commented 6 years ago

I can find anything really conclusive about if it has to be build with python2 or 3... https://grasswiki.osgeo.org/wiki/Compiling_on_MacOSX

I've read that grass 7 still depends on python2 a lot, but I'm not sure if it has to be build with 2 o 3 version.

Perhaps @kyngchaos can give us some clue?

kyngchaos commented 6 years ago

I think GRASS 7 is OK with Python 3, at least GRASS 7.2. And it probably needs to be for QGIS 3 because QGIS includes its own Python shell to run commands, and QGIS 3 requires Python 3.

For the GRASS GUI popping up (I didn't read everything above, maybe you figured it out already), I use a custom GRASS startup that forces a text gui. In grass7x, main():

default_gui = "text"

And just to make sure python 3 is used (I'm not sure how they run from processing), change the shebang at the top of grass7x and all GRASS python scripts:

#!/usr/bin/env python3

fjperini commented 6 years ago

@luisspuerto Then we need to build GRASS with python3. Test with this formula and verify that the problem with the script is solved.

nickrobison commented 6 years ago

@fjperini @luisspuerto I'm having a difficult time following all the comments in the thread, can you please summarize for me what the current state of this ticket is?

Are we still experiencing the Grass window popping up?

Are the python3 modules being loaded correctly?

fjperini commented 6 years ago

@nickrobison The GRASS window no longer appears. The modules are installed correctly, a path was incorrect. I have already solved it, I will upload the changes.

The new thing that emerged is that it seems necessary to build GRASS with python3.

nickrobison commented 6 years ago

@fjperini Why is it necessary to build GRASS with python3?

fjperini commented 6 years ago

@nickrobison Because PYTHONPATH conflicts

Your PYTHONPATH points to a site-packages dir for Python 3.x but you are running Python 2.x!

PYTHONPATH is currently: "/usr/local/opt/gdal2-python/lib/python3.7/site-packages:/usr/local/opt/qgis3/lib/python3.7/site-packages:/usr/local/opt/qgis3/libexec/python/lib/python3.7/site-packages:/usr/local/lib/python3.7/site-packages"

You should `unset PYTHONPATH` to fix this.

Error while executing a script. it would be the only thing left to solve.

nickrobison commented 6 years ago

Where is that error generated? In QGIS?

fjperini commented 6 years ago

@nickrobison Yes, an error when running a GRASS scripts. @luisspuerto reported this problem.

luispuerto commented 6 years ago

@nickrobison & @fjperini the error is generated while trying to use one script on the grass toolbox on qgis3.

I tried to build with that grass7 formula, but I don't think it's working. Think that it's probably just using the bottle... It's no working because the error still there.

fjperini commented 6 years ago

@luisspuerto Build GRASS from source with python3 I made some changes to solve the problem with the modules. It only remains to solve what happens with the script.

fjperini commented 6 years ago

@luisspuerto You tried before with this

I use a custom GRASS startup that forces a text gui. In grass7x, main(): default_gui = "text"

change the shebang at the top of grass7x and all GRASS python scripts:

!/usr/bin/env python3