Opened 6 years ago
Closed 6 years ago
#3731 closed defect (fixed)
winGRASS7.7.svn python3 build issues
Reported by: | martinl | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.0 |
Component: | Python ctypes | Version: | svn-trunk |
Keywords: | wingrass, python3, py3 | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
WinGRASS daily builds no. 372+ fails with
File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\nviz\wxnviz.py", line 53, in <module> from grass.lib.vector import * File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\etc\python\grass\lib\vector.py", li ne 340 SF_POINT25D = 2147483649L # C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mi ngw32/include/grass/vect/dig_defines.h: 257 ^ SyntaxError: invalid syntax
Attachments (1)
Change History (19)
comment:1 by , 6 years ago
follow-up: 3 comment:2 by , 6 years ago
From: Anna Petrášová <kratochanna@…> Date: Do., 13. Sep. 2018, 22:30 Subject: Re: [GRASS-user] experimental Python 3 support in trunk
On Tue, Sep 4, 2018 at 2:00 AM Markus Neteler <neteler@…> wrote: On Tue, Sep 4, 2018 at 12:39 AM Anna Petrášová <kratochanna@…> wrote:
from grass.pygrass.vector import VectorTopo File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/vector/__init__.py", line 7, in <module> import grass.lib.vector as libvect File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/lib/vector.py", line 5863 PORT_LONG_MAX = 2147483647L ^ SyntaxError: invalid syntax
regarding this issue, make sure you compile GRASS with Python 3. I get this if I compile it with Python2 and then open it with Python 3.
Anna
follow-up: 5 comment:3 by , 6 years ago
Replying to neteler:
From: Anna Petrášová <kratochanna@…> Date: Do., 13. Sep. 2018, 22:30 Subject: Re: [GRASS-user] experimental Python 3 support in trunk
On Tue, Sep 4, 2018 at 2:00 AM Markus Neteler <neteler@…> wrote: On Tue, Sep 4, 2018 at 12:39 AM Anna Petrášová <kratochanna@…> wrote:
from grass.pygrass.vector import VectorTopo File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/pygrass/vector/__init__.py", line 7, in <module> import grass.lib.vector as libvect File "/home/mneteler/software/grass77/dist.x86_64-pc-linux-gnu/etc/python/grass/lib/vector.py", line 5863 PORT_LONG_MAX = 2147483647L ^ SyntaxError: invalid syntaxregarding this issue, make sure you compile GRASS with Python 3. I get this if I compile it with Python2 and then open it with Python 3.
Anna
for compilation in package.sh we do:
# Force Python3 alias python=python3
adding later in the script e.g.
[...] exec 3>&1 >> mswindows/osgeo4w/package.log 2>&1 python --version [...]
I get
Python 3.7.2 Sat Jan 12 15:29:17 CET 2019: STARTING dll.to.a /c/OSGeo4W64/bin/proj_5_2.dll => mswindows/osgeo4w/lib/libproj [...]
it seems python3 is used for compilation.
comment:5 by , 6 years ago
comment:6 by , 6 years ago
Unfortunately last build is still no. 372. There is a new issue with building manual pages on build server
Traceback (most recent call last): File "C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/tools/g.html2man.py", line 77, in <module> main() File "C:/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/tools/g.html2man.py", line 73, in main outf.write(s) File "C:/OSGeo4W64/apps/Python37\lib\encodings\cp1250.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' codec can't encode character '\u2264' in position 2582: character maps to <undefined> ../../include/Make/Html.make:11: recipe for target '/c/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/docs/man/man1/r.clump.1' failed make[4]: *** [/c/msys64/usr/src/grass_trunk/dist.x86_64-w64-mingw32/docs/man/man1/r.clump.1] Error 1
comment:7 by , 6 years ago
Summary: | winGRASS7.7.svn - ctypes - python 3 issues → winGRASS7.7.svn python3 build issues |
---|
comment:10 by , 6 years ago
Build no. 375 fails with new issues
Traceback (most recent call last): File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\wxgui.py", line 103, in OnInit workspace=self.workspaceFile) File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\lmgr\frame.py", line 131, in __init__ self._moduleTreeBuilder = LayerManagerModuleTree(message_handler=add_menu_error) File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\lmgr\menudata.py", line 69, in __init__ message_handler=message_handler) File "C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\core\menutree.py", line 72, in __init__ xmlTree = etree.parse(filename) File "C:\OSGEO4~1\apps\Python37\lib\xml\etree\ElementTree.py", line 1197, in parse tree.parse(source, parser) File "C:\OSGEO4~1\apps\Python37\lib\xml\etree\ElementTree.py", line 598, in parse self._root = parser._parse_whole(source) xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Reason: C:\OSGEO4~1\apps\grass\grass-7.7.svn\gui\wxpython\xml\module_tree_menudata.xml
is empty.
Related traceback:
Traceback (most recent call last): File "core/toolboxes.py", line 914, in <module> sys.exit(main()) File "core/toolboxes.py", line 898, in main userDefined=False) File "core/toolboxes.py", line 307, in createTree moduleItems=moduleItems) File "core/toolboxes.py", line 344, in toolboxes2menudata _expandRuntimeModules(root) File "core/toolboxes.py", line 645, in _expandRuntimeModules desc, keywords = _loadMetadata(name) File "core/toolboxes.py", line 682, in _loadMetadata task = gtask.parse_interface(module) File "C:\msys64\usr\src\grass_trunk\dist.x86_64-w64-mingw32\etc\python\grass\script\task.py", line 524, in parse_interface tree = etree.fromstring(get_interface_description(name)) File "C:\msys64\usr\src\grass_trunk\dist.x86_64-w64-mingw32\etc\python\grass\script\task.py", line 476, in get_interface_description stderr=PIPE) File "C:\msys64\usr\src\grass_trunk\dist.x86_64-w64-mingw32\etc\python\grass\script\core.py", line 66, in __init__ cmd = shutil_which(args[0]) File "C:\msys64\usr\src\grass_trunk\dist.x86_64-w64-mingw32\etc\python\grass\script\core.py", line 222, in shutil_which if any(cmd.lower().endswith(ext) for ext in pathext): File "C:\msys64\usr\src\grass_trunk\dist.x86_64-w64-mingw32\etc\python\grass\script\core.py", line 222, in <genexpr> if any(cmd.lower().endswith(ext) for ext in pathext): TypeError: endswith first arg must be str or a tuple of str, not bytes Makefile:46: recipe for target 'xml/module_tree_menudata.xml' failed make[4]: *** [xml/module_tree_menudata.xml] Error 1
follow-up: 13 comment:11 by , 6 years ago
I added some debug messages around. The thumbnails.py
scripts calls before g.region
command the g.gisenv
command(but how and where?). The problem is that once cmd
is a string (should be bytes, if I am right(?) and then bytes.
g.gisenv <class 'str'> b'g.region' <class 'bytes'>
comment:13 by , 6 years ago
by , 6 years ago
Attachment: | wingrass_python3.png added |
---|
comment:16 by , 6 years ago
comment:17 by , 6 years ago
Reported issue seems to be solved, closing. Feel free to reopen if needed.
comment:18 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Comparing
vector.py
file compiled onWindows:
and Linux
Any idea how to avoid
L
suffix?