Closed kikislater closed 2 years ago
See #2040 for reference. Seems the same issue. Maybe wxpython or wxwidgets didn't get the fixes yet (?)
Hum ok, That's what I was looking for but I didn't find it unfortunately ...
Yes it is related to Python 3.10 version and wxPython 4.1.1 (last official release is from 2020-11-21 00:00) in this case. The release of the new version will probably take some time.
I think it would be good to inform users what combination of Python and wxPython will allow the G7/G8 version to work through our website (not all users are able to apply wxPython patches).
I think it would be good to inform users what combination of Python and wxPython will allow the G7/G8 version to work through our website (not all users are able to apply wxPython patches).
Agreed with that. IMO from user experience, these wx bugs are annoying
Yes it is related to Python 3.10 version and wxPython 4.1.1 (last official release is from 2020-11-21 00:00) in this case. The release of the new version will probably take some time.
I think it would be good to inform users what combination of Python and wxPython will allow the G7/G8 version to work through our website (not all users are able to apply wxPython patches).
Agreed! Would you mind helping out with a small text snippet regarding which python/wxpython versions work well with which GRASS versions? An advise for advanced users might be worth it as well.
A simple advice is to use Python <= 3.9. If you need Python >= 3.10, you need latest GRASS and latest wxPython. WxPython daily snapshots for Mac and Windows are available here, for linux you need to compile wxPython yourself.
So I rebuild python-wxpython 4.1.1 with this patch : https://github.com/wxWidgets/Phoenix/commit/aa3dca0e40bd0701e82ce40297a982b5b84844dc as suggested in other linked issue Then rebuild grass and ... it doesn't work ! Icons are still shifted whereas in 8 it works.
Grass 8.0.0RC1 doesn't work better in Archlinux based distributions :
g.extension.all -f
is broken* Problem with extensions : `g.extension.all -f` is broken
Would you please open a separate bug report for this and set the 8.0.0 milestone
* GRASS scripts like v.triangle have a grass 7 check. They need to be updated. So no stable usage at this time
Which GRASS version is this module or add-on from? I do not find it in core or addons lists. In any case, the version checks for addons are a work in progress and ideally addon authors should take care of that. If this is not in GRASS official repo, you could report with the author.
* Building QGIS with GRASS 8 and QGIS will not find GRASS
Maybe this could be reported/requested in QGIS too. IIRC it was a hardcoded thing. For the GRASS plugin though, you can customize the GRASS version you want
* No single UI or I didn't find the option to enable it
This is only available in main branch, so you'd need to compile that one. It's planned for 8.2 release
So I rebuild python-wxpython 4.1.1 with this patch : wxWidgets/Phoenix@aa3dca0 as suggested in other linked issue Then rebuild grass and ... it doesn't work ! Icons are still shifted whereas in 8 it works.
There are many more patches needed... I think this one is an important one as well.
* Problem with extensions : `g.extension.all -f` is broken
Reinstallation of composed addons such as wx.metadata (multiple modules) is problematic and doesn't work.
See #2040 for reference. Seems the same issue. Maybe wxpython or wxwidgets didn't get the fixes yet (?)
You can locally patch your wxpython installation with https://github.com/wxWidgets/Phoenix/commit/aa3dca0e40bd0701e82ce40297a982b5b84844dc
If it helps (very likely, as it did for me), then pls tell the wxpython maintainer in archlinux to patch the wxpython package accordingly. As @petrasovaa says, many more patches are needed. You may cherry-pick them from here: https://src.fedoraproject.org/rpms/python-wxpython4/commits/rawhide
So I rebuild python-wxpython 4.1.1 with this patch : wxWidgets/Phoenix@aa3dca0 as suggested in other linked issue Then rebuild grass and
BTW: AFAIK no need to recompile GRASS when fixing wxpython. It will run out of the box (or not).
@veroandreo : Thank you, I will report g.extension bug but @tmszi already says it will not work. It was just an alert from grass 7 that we have to rebuild extensions so should it be ignored in 8's version ? For grass scripts, there are only fews and minor editing is needed : https://github.com/amuriy/GRASS-scripts Ok for the main Ui, it's a bit confusing as it seems to be the main feature users would like to test with 8
@petrasovaa : it works now ! Thanks @neteler : Thanks, it works with more patches like said above without rebuilding grass. BTW, building GRASS is not that long nowaday (we have more powerfull laptops/desktops) ...
But there is something disturbing :
wxPython is released as 4.1.1 ... no new version since this one, so advising about wxPython not released is more than confusing. All distribution will be break for GRASS and not be able to run GRASS GIS ...
If you refer to https://github.com/wxWidgets/Phoenix/releases then I don't know. You find the current releases actually here: https://pypi.org/project/wxPython/#history
Check the commit history, there are plenty of recent improvements (and some even came from @petrasovaa!): https://github.com/wxWidgets/Phoenix/commits/master
All distribution will be break for GRASS and not be able to run GRASS GIS ...
Not exactly: e.g. in Fedora the shipped version is wxPython 4.0.7, with plenty of backports. It works quite nicely and reported issues have been quickly fixed. See here that many distros still stick to wxPython 4.0.7: https://repology.org/project/python:wxpython/versions
I was referring to https://wxpython.org/ WxWidgets is too confusing for me ^^ I never understood this break between 4.0.7 and newer version as some consider 4.1.1 to be a development version
It is changes in Python 3.10 that triggers these problems, independent of wxPython version. Please see https://github.com/wxWidgets/Phoenix/issues/2038 for discussion.
Agreed! Would you mind helping out with a small text snippet regarding which python/wxpython versions work well with which GRASS versions? An advise for advanced users might be worth it as well.
Python / wxPython version | GRASS GIS 7.8.6 | GRASS GIS 8.0.0 RC1 |
---|---|---|
Python <= 3.9 / wxPython = 4.0.7.post2 gtk3 (phoenix) wxWidgets 3.0.5 1 | work | work |
Python <= 3.9 / wxPython = 4.1.1 gtk3 (phoenix) wxWidgets 3.1.5 1 | work | work |
Python = 3.10 / wxPython = 4.0.7.post2 gtk3 (phoenix) wxWidgets 3.0.5 1 | doesn't work | doesn't work |
Python = 3.10 / wxPython = 4.1.1 gtk3 (phoenix) wxWidgets 3.1.5 1 | doesn't work | doesn't work |
Python = 3.10 / wxPython = last code from master git branch 2 | doesn't work 3 | work |
1 offcial wxPython release without patches 2 require self compilation 3 require self compiled last code from releasebranch_7_8 git branch
How to detect the Python / wxPython version?
tomas@gentoo-gnu-linux:~$ python -c "import sys, wx; print(sys.version, wx.version())"
3.9.9 (main, Dec 5 2021, 18:02:20)
[GCC 11.2.0] 4.0.7.post2 gtk3 (phoenix) wxWidgets 3.0.5
Python 3.9.9 version wxPython 4.0.7.post2 gtk3 (phoenix) wxWidgets 3.0.5 version
wxPython self compilation (OS GNU/Linux) require compiler collection (gcc, gcc-c+...) to be installed and last wxPython code from master git branch. After the compilation process is complete, Python binary wheel file wxPython-4.1.2a1-cp310-cp310-linux_x86_64.whl is created for installation in an isolated virtual Python environment.
tomas@gentoo-gnu-linux:~/src/wxpython-master-branch$ git clone https://github.com/wxWidgets/Phoenix.git
tomas@gentoo-gnu-linux:~/src/wxpython-master-branch$ cd Phoenix/
tomas@gentoo-gnu-linux:~/src/wxpython-master-branch$ git submodule update --init --recursive
tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ python3.10 -m venv ../venv
tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ source ../venv/bin/activate && pip install sip==5.5.0
(venv) tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ python build.py dox etg --nodoc sip build
(venv) tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ python setup.py bdist_wheel --universal
(venv) tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ pip install dist/wxPython-4.1.2a1-cp310-cp310-linux_x86_64.whl
(venv) tomas@gentoo-gnu-linux:~/src/wxpython-master-branch/Phoenix$ python -c "import wx; print(wx.version())"
4.1.2a1 gtk3 (phoenix) wxWidgets 3.1.5
Python <= 3.9 / wxPython = 4.0.7.post2 gtk3 (phoenix) wxWidgets 3.0.5 1
7.8.6 runs as well with Python <= 3.9 / wxPython = 4.1.1 / wxWidgets 3.0.5 1 I know it's not common but we had no issue with it !
And >= 7.8.5 needs wxPython 4.1.1 otherwise you fall into this issue : https://github.com/OSGeo/grass/issues/1261
And >= 7.8.5 needs wxPython 4.1.1 otherwise you fall into this issue : #1261
Did you already try with the current release_branch_7_8
(upcoming 7.8.7)? Several GUI fixes have been done, for me it works fine with the enhanced wxpython 4.0.7 (Fedora 35).
yes it was mentionned in post 1 of this thread inside quoted PKGBUILD (bash script to build package on archlinux). But we don't have backports of patches you have in fedora 35 for wxpython 4.0.7
source=("https://github.com/OSGeo/grass/archive/refs/heads/releasebranch_7_8.zip")
But now everything (7.8.7 from yesterday) is ok since I patched wxpython 4.1.1 as mention above. I will stay with this version at this time as :
* 8.0.0RC1 don't have single window and it still confuse with g.extension in this version,
If you want try experimental single window mode, you have to compile GRASS GIS dev main git branch (this functionality is not planned for version 8.0.0) as mentioned above.
Could you specify exactly what you have a problem with the g.extension module?
Hi All,
Finally, WxPython 4.1 wasn't a solution ... Grass works well with it but it breaks others softwares like filezilla. Filezilla even dev branch doesn't build with wxgtk > 3.0.5. Filezilla consider (as well for Archlinux) that WxWidgets 3.1.5 and WxPython 4.1.1 is a development version ... So Grass works but it breaks other software, not only filezilla ! (mediainfo, gnuplot, poedit, audacity among others.
Edit :
And I tried backporting patch to 4.0.7 but fail with same issue : https://github.com/OSGeo/grass/issues/2019 as @petrasovaa said, it needs 4.1 ... Finally no solution !
Still happen in grass 8.0.1 on layer tab with WxWidgets 3.1.5 and WxPthon 4.1.1 :
@kikislater can you please try with 8.2.0RC2?
Do you mean RC1 ? I couldn't find RC2
problem still occur but now I found the culprit, problem is in wxpython flatnotebook.py, some values are still float. Errors could be shown in console output. I will a push a PR and will report here
Example with grass 8.0.2
Perhaps the offending line in your version of flatnotebook.py
needs to be
dc.DrawText(pc.GetPageText(tabIdx), int(posx + textOffset), imageYCoord)
Here are patches applied in the Fedora version which are AFAIK also merged in upstream: https://src.fedoraproject.org/rpms/python-wxpython4/blob/b8b9030f9a6d1ee1ac443280e578cfac782df451/f/587f3418f2b772cfd24686f4448a29f340791e6b.patch
Mine was also be patched with this commit => https://github.com/wxWidgets/Phoenix/commit/aa3dca0e40bd0701e82ce40297a982b5b84844dc
Others lines needs to be modified :
$ cat flatnotebook.py | grep dc.DrawText
mem_dc.DrawText("Opened tabs:", txtPt.x, txtPt.y)
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
dc.DrawText(pc.GetPageText(tabIdx), int(posx + textOffset), imageYCoord)
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, imageYCoord)
dc.DrawText(pc.GetPageText(tabIdx), posx + textOffset, int(imageYCoord))
So finally, I got it !
In Manjaro / Archlinux, we have the release of wxpython 4.1.1 in AUR (Arch User Repository) but these patches need to be added :
https://github.com/wxWidgets/Phoenix/commit/aa3dca0e40bd0701e82ce40297a982b5b84844dc https://github.com/wxWidgets/Phoenix/commit/f5a55e6bf38ab5a0e7b7161477d2d523d057ec29 https://github.com/wxWidgets/Phoenix/commit/d9725119d742ff25e815d0824c62abd8953a61df
Usable PKGBUILD available here : https://github.com/giscan/AUR/tree/main/python-wxpython-dev
Describe the bug Icons are not in the right place making GUI unusable
To Reproduce Steps to reproduce the behavior:
Expected behavior Icons fit the right place with right mouse hover
Screenshots If applicable, add screenshots to help explain your problem.
System description (please complete the following information):
Additional context It doesn't happen with GRASS 8.0.0RC1 (screenshot below)