Problem building wxpython on windows

hello, I’m trying to compile wxpython+wxwidgets on a win10 PC. I’ve overcome the attrdict dependency problem, updated wxwidgets submodule but when I run the command below I get the error

impossible creating ‘…\3rdparty\pcre\src\pcre2_auto_possess.c’

It looks a path problem to me because these are the paths to wxpython local repo and 3rdparty dir:
C:\Users\kaneido1\Documents\python\wxPython
C:\Users\kaneido1\Documents\python\wxPython\ext\wxWidgets\3rdparty

Is there some option that can be set to avoid this?

thank you in advance

Marco

(af42311dev) C:\Users\kaneido1\Documents\python\wxPython>python -u build.py build
Will build using: "C:\Users\kaneido1\Envs\af42311dev\Scripts\python.exe"
3.11.4 (tags/v3.11.4:d2340ef, Jun  7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.2.2a1

Running command: build
Running command: build_wx
CL.exe: C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX64\x64\cl.exe
wxWidgets build options: ['--wxpython', '--unicode']
Updating wx/msw/setup.h
setting build options...
nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

Microsoft (R) Program Maintenance Utility versione 14.36.32535.0
Copyright (C) Microsoft Corporation. Tutti i diritti riservati.

NMAKE : fatal error U1073: impossibile creare '..\..\3rdparty\pcre\src\pcre2_auto_possess.c'
Stop.
Error building
ERROR: failed building wxWidgets
Traceback (most recent call last):
  File "C:\Users\kaneido1\Documents\python\wxPython\build.py", line 1568, in cmd_build_wx
    wxbuild.main(wxDir(), build_options)
  File "C:\Users\kaneido1\Documents\python\wxPython\buildtools\build_wxwidgets.py", line 503, in main
    exitIfError(wxBuilder.build(dir=buildDir, options=args), "Error building")
  File "C:\Users\kaneido1\Documents\python\wxPython\buildtools\build_wxwidgets.py", line 72, in exitIfError
    raise builder.BuildError(msg)
buildtools.builder.BuildError: Error building
Finished command: build_wx (0m1.12s)
Finished command: build (0m1.12s)

wxWidgets also has submodules, so you need to do git submodule update --recursive and I usually add --init in case they add a new one without me noticing.

thank you Robin, I overlooked the docs. I’ve gone forward setting up visual C and WSL and now when I run the build command I get errors about paths. Is there some other step that I’ve missed? The various folders and exes cited in the log are present. My doubt is about the slashes instead of backslashes in C:/Users/kaneido1/Documents/python/wxPython/ext/wxWidgets/docs/doxygen (I’m on Win10)

(af42311dev) C:\Users\kaneido1\Documents\python\wxPython>python build.py dox etg --nodoc sip build
Will build using: "C:\Users\kaneido1\Envs\af42311dev\Scripts\python.exe"
3.11.4 (tags/v3.11.4:d2340ef, Jun  7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)]
Python's architecture is 64bit
cfg.VERSION: 4.2.2a1

Running command: dox
Checking for C:\Users\kaneido1\Documents\python\wxPython\bin\doxygen-1.8.8-win32.exe...
/mnt/c/Users/kaneido1/Documents/python/wxPython/bin/doxygen-1.8.8-win32.exe
"C:\Windows\system32\bash.exe" -l -c "cd C:/Users/kaneido1/Documents/python/wxPython/ext/wxWidgets/docs/doxygen && ./regen.sh xml"
/bin/bash: line 1: cd: C:/Users/kaneido1/Documents/python/wxPython/ext/wxWidgets/docs/doxygen: No such file or directory
Command '"C:\Windows\system32\bash.exe" -l -c "cd C:/Users/kaneido1/Documents/python/wxPython/ext/wxWidgets/docs/doxygen && ./regen.sh xml"' failed with exit code 1.
Finished command: dox (0m7.833s)

The bash.exe expected there is cygwin, or maybe git’s bash, not WSL.

If I would like to propose patches for wx.lib.pdfviewer (newest wxP now requires
ints and rejects floats for pos/size) - can I just post them to the list ?

Thanks,
Karsten

Or even better, send pull requests. :slight_smile:

Here goes (apply to wx/lib/pdfviewer/viewer.py):

snip ------------------------------------------------------------------------

— viewer.py.orig 2023-09-08 18:31:33.038194349 +0200
+++ viewer.py 2023-09-08 21:58:35.059298635 +0200
@@ -47,7 +47,8 @@
# see http://pythonhosted.org/PyPDF2
import PyPDF2
from PyPDF2 import PdfFileReader

  •    from PyPDF2.pdf import ContentStream, PageObject
    
  •    from PyPDF2.generic import ContentStream
    
  •    from PyPDF2 import PageObject
       from PyPDF2.filters import ASCII85Decode, FlateDecode
       if VERBOSE: print('pdfviewer using PyPDF2')
    
    except ImportError:
    @@ -173,7 +174,7 @@
    paintDC.Clear() # in case buffer now smaller than visible window
    if hasattr(self, ‘pdc’):
    paintDC.Blit(0, 0, self.winwidth, self.winheight, self.pdc,
  •                                                self.xshift, self.yshift)
    
  •                                                 int(self.xshift), int(self.yshift))
    

(Attachment viewer.py.patch is missing)

Here goes (apply to wx/lib/pdfviewer/viewer.py):

Attachment was rejected (.patch) so retrying with (dummy)
*.patch.py …

The (trivial) patch was also already included within the mail
body.

Best,
Karsten

viewer.py.patch.py (2.29 KB)