I’ve tried to compile the wxPython-4.2.0 source code on Tumbleweed and it fails. I am including the o/p bellow:
user@pc-116:~> python -m pip install -U wxpython
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Requirement already satisfied, skipping upgrade: pillow in ./.local/lib/python2.7/site-packages (from wxpython) (6.2.2)
Requirement already satisfied, skipping upgrade: six in ./.local/lib/python2.7/site-packages (from wxpython) (1.16.0)
Requirement already satisfied, skipping upgrade: numpy<1.17 in ./.local/lib/python2.7/site-packages (from wxpython) (1.16.6)
Building wheels for collected packages: wxpython
Building wheel for wxpython (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-E8Cs57
cwd: /tmp/pip-install-Q37Cjo/wxpython/
Complete output (14 lines):
running bdist_wheel
running build
WARNING: Building this way assumes that all generated files have been
generated already. If that is not the case then use build.py directly
to generate the source and perform the build stage. You can use
--skip-build with the bdist_* or install commands to avoid this
message and the wxWidgets and Phoenix build steps in the future.
"/usr/bin/python" -u build.py build
File "build.py", line 805
msg(f"CL.exe: {CL}")
^
SyntaxError: invalid syntax
Command '"/usr/bin/python" -u build.py build' failed with exit code 1.
----------------------------------------
ERROR: Failed building wheel for wxpython
Running setup.py clean for wxpython
Failed to build wxpython
Installing collected packages: wxpython
Running setup.py install for wxpython ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-aCO6Hk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/user/.local/include/python2.7/wxpython
cwd: /tmp/pip-install-Q37Cjo/wxpython/
Complete output (14 lines):
running install
running build
WARNING: Building this way assumes that all generated files have been
generated already. If that is not the case then use build.py directly
to generate the source and perform the build stage. You can use
--skip-build with the bdist_* or install commands to avoid this
message and the wxWidgets and Phoenix build steps in the future.
"/usr/bin/python" -u build.py build
File "build.py", line 805
msg(f"CL.exe: {CL}")
^
SyntaxError: invalid syntax
Command '"/usr/bin/python" -u build.py build' failed with exit code 1.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Q37Cjo/wxpython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-aCO6Hk/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/user/.local/include/python2.7/wxpython Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 22.3.1 is available.
You should consider upgrading via the '/usr/bin/python -m pip install --upgrade pip' command.
user@pc-116:~> python --version
Python 2.7.18
user@pc-116:~> python -m pip --version
pip 20.0.2 from /home/user/.local/lib/python2.7/site-packages/pip (python 2.7)
user@pc-116:~>
The directory ~/.local/include/python2.7/wxpython does not exists after the above process so I cannot access any log files probably from some kind of clean up.
Am I missing something or is a known problem for Tumbleweed?
Yes, from the documentation of wxPython I have read that it is mandatory to use 2.7 in order to compile. I do have both 3.10 and 2.7 in my system but I used 2.7.18 python in order to compile the package.
I’ll give it a try with both latest pip and 3.10 python to see if it works.
user@pc-116:~/tmp> python3 -m pip install -U wxpython
Defaulting to user installation because normal site-packages is not writeable
Collecting wxpython
Using cached wxPython-4.2.0.tar.gz (71.0 MB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-lxqm7tbr/wxpython_750f6439e61f421bb5078d5122927619/setup.py", line 27, in <module>
from buildtools.config import Config, msg, opj, runcmd, canGetSOName, getSOName
File "/tmp/pip-install-lxqm7tbr/wxpython_750f6439e61f421bb5078d5122927619/buildtools/config.py", line 30, in <module>
from attrdict import AttrDict
File "/home/user/.local/lib/python3.10/site-packages/attrdict/__init__.py", line 5, in <module>
from attrdict.mapping import AttrMap
File "/home/user/.local/lib/python3.10/site-packages/attrdict/mapping.py", line 4, in <module>
from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib64/python3.10/collections/__init__.py)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
user@pc-116:~/tmp>
I did try to install all the dependencies as attrdict, attrmap and mapping successfully for python3 but the result keeps coming the same
Thanks to your guidance I’ve managed to proceed to the compilation only to stuck further down with the following o/p:
make[1]: Leaving directory '/tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/ext/wxWidgets/locale'
Finished command: build_wx (0.886s)
Running command: build_py
Checking for /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/bin/waf-2.0.24...
"/usr/bin/python3" /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/bin/waf-2.0.24 --wx_config=/tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/bin/python3" --out=build/waf/3.10/gtk3 configure build
Setting top to : /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151
Setting out to : /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/build/waf/3.10/gtk3
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for program 'python' : /usr/bin/python3
Checking for python version >= 3.7.0 : 3.10.8
python-config : not found
Checking for library python3.10 in LIBDIR : not found
Checking for library python3.10 in python_LIBPL : not found
Checking for library python3.10 in $prefix/libs : not found
Checking for library python3.10 in $INCLUDEPY/../libs : not found
Checking for library python3.10m in LIBDIR : not found
Checking for library python3.10m in python_LIBPL : not found
Checking for library python3.10m in $prefix/libs : not found
Checking for library python3.10m in $INCLUDEPY/../libs : not found
Checking for library python310 in LIBDIR : not found
Checking for library python310 in python_LIBPL : not found
Checking for library python310 in $prefix/libs : not found
Checking for library python310 in $INCLUDEPY/../libs : not found
Checking for header Python.h : Distutils not installed? Broken python installation? Get python-config now!
The configuration failed
(complete log in /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/build/waf/3.10/gtk3/config.log)
Command '"/usr/bin/python3" /tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/bin/waf-2.0.24 --wx_config=/tmp/pip-install-szp36epl/wxpython_b9659830c5624675958b422678235151/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/bin/python3" --out=build/waf/3.10/gtk3 configure build ' failed with exit code 1.
Finished command: build_py (0m2.298s)
Finished command: build (0m3.185s)
Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> wxpython
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I installed python-config and run the installation once more but it failed with the same result. I did not find anything on the net for this issue relevant. Is there another package missing too?
Found it! Had to install the header files and static libraries for python dev only to stuck just further down with the following o/p:
Running command: build_py
Checking for /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/bin/waf-2.0.24...
"/usr/bin/python3" /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/bin/waf-2.0.24 --wx_config=/tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/bin/python3" --out=build/waf/3.10/gtk3 configure build
Setting top to : /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d
Setting out to : /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/waf/3.10/gtk3
Checking for 'gcc' (C compiler) : /usr/bin/gcc
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for program 'python' : /usr/bin/python3
Checking for python version >= 3.7.0 : 3.10.8
python-config : /usr/bin/python3-config
Asking python-config for pyext '--cflags --libs --ldflags' flags : yes
Testing pyext configuration : yes
Finding libs for WX : yes
Finding libs for WXADV : yes
Finding libs for WXSTC : yes
Finding libs for WXHTML : yes
WARNING: Unable to find setup.h in /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/wxbld/gtk3/lib64/wx/include/gtk3-unicode-3.2, assuming wxUSE_GLCANVAS is not available.
Finding libs for WXGL : yes
WARNING: Unable to find setup.h in /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/wxbld/gtk3/lib64/wx/include/gtk3-unicode-3.2, assuming wxUSE_WEBVIEW is not available.
Finding libs for WXWEBVIEW : yes
Finding libs for WXXML : yes
Finding libs for WXXRC : yes
Finding libs for WXRICHTEXT : yes
WARNING: Unable to find setup.h in /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/wxbld/gtk3/lib64/wx/include/gtk3-unicode-3.2, assuming wxUSE_MEDIACTRL is not available.
Finding libs for WXMEDIA : yes
Finding libs for WXRIBBON : yes
Finding libs for WXPROPGRID : yes
Finding libs for WXAUI : yes
'configure' finished successfully (2.288s)
Waf: Entering directory `/tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/waf/3.10/gtk3'
**** Compiler: gcc --version
gcc (SUSE Linux) 12.2.1 20221020 [revision 0aaef83351473e8f4eb774f8f999bbe87a4866d7]
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[ 11/937] Linking build/waf/3.10/gtk3/siplib.cpython-310-x86_64-linux-gnu.so
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: cannot find -lwx_gtk3u_core-3.2: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: cannot find -lwx_baseu_net-3.2: No such file or directory
/usr/lib64/gcc/x86_64-suse-linux/12/../../../../x86_64-suse-linux/bin/ld: cannot find -lwx_baseu-3.2: No such file or directory
collect2: error: ld returned 1 exit status
Waf: Leaving directory `/tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/waf/3.10/gtk3'
Build failed
-> task in 'siplib' failed with exit status 1 (run with -v to display more information)
Command '"/usr/bin/python3" /tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/bin/waf-2.0.24 --wx_config=/tmp/pip-install-5olclst_/wxpython_ca20ab7c00dc4b339b531d5fc210cc4d/build/wxbld/gtk3/wx-config --gtk3 --python="/usr/bin/python3" --out=build/waf/3.10/gtk3 configure build ' failed with exit code 1.
Finished command: build_py (0m3.486s)
Finished command: build (0m5.540s)
Command '"/usr/bin/python3" -u build.py build' failed with exit code 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> wxpython
It seems that there is a symbolic link that points to the directory the script is trying to access but its the first time that I see symbolic links with an asterisk and I do not know what that is in Tumbleweed. Changing folder manually does not either work:
user@pc-116:/usr/x86_64-suse-linux/bin> l
total 24
drwxr-xr-x 1 root root 38 Nov 15 03:03 ./
drwxr-xr-x 1 root root 26 Oct 8 02:48 ../
lrwxrwxrwx 1 root root 12 Aug 31 19:35 ar -> ../../bin/ar*
lrwxrwxrwx 1 root root 12 Aug 31 19:35 as -> ../../bin/as*
lrwxrwxrwx 1 root root 12 Aug 31 19:35 ld -> ../../bin/ld*
lrwxrwxrwx 1 root root 12 Aug 31 19:35 nm -> ../../bin/nm*
lrwxrwxrwx 1 root root 16 Aug 31 19:35 ranlib -> ../../bin/ranlib*
lrwxrwxrwx 1 root root 15 Aug 31 19:35 strip -> ../../bin/strip*
user@pc-116:/usr/x86_64-suse-linux/bin> cd ld
bash: cd: ld: Not a directory
user@pc-116:/usr/x86_64-suse-linux/bin>
Yet today I did follow the instructions and ended up with this o/p:
[ 11/937] Compiling sip/cpp/sip_corewxListView.cpp
In file included from ../../../../ext/wxWidgets/include/wx/defs.h:45,
from ../../../../ext/wxWidgets/include/wx/wx.h:14,
from ../../../../wx/include/wxPython/wxpy_api.h:41,
from ../../../../sip/cpp/sipAPI_core.h:22040,
from ../../../../sip/cpp/sip_corewxListView.cpp:10:
../../../../ext/wxWidgets/include/wx/platform.h:159:10: fatal error: wx/setup.h: No such file or directory
159 | #include "wx/setup.h"
| ^~~~~~~~~~~~
compilation terminated.
Waf: Leaving directory `/tmp/pip-req-build-zz9khi6m/build/waf/3.10/gtk3'
Build failed
-> task in '_core' failed with exit status 1 (run with -v to display more information)
Command '"/home/user/tmp/builder_py/bin/python3" /tmp/pip-req-build-zz9khi6m/bin/waf-2.0.24 --wx_config=/tmp/pip-req-build-zz9khi6m/build/wxbld/gtk3/wx-config --gtk3 --python="/home/user/tmp/builder_py/bin/python3" --out=build/waf/3.10/gtk3 configure build ' failed with exit code 1.
Finished command: build_py (0m7.524s)
Finished command: build (13m15.192s)
Command '"/home/user/tmp/builder_py/bin/python3" -u build.py build' failed with exit code 1.
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/user/tmp/builder_py/bin/python3 -u -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
# import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
# setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
# manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize
try:
import setuptools
except ImportError as error:
print(
"ERROR: Can not execute `setup.py` since setuptools is not available in "
"the build environment.",
file=sys.stderr,
)
sys.exit(1)
A pick in the directory where setuptools is installed in this virtual python environment found the following list:
(builder_py) user@pc-116:~/tmp/builder_py/lib/python3.10/site-packages/setuptools> l
total 1016
drwxr-xr-x 1 user user 1002 Nov 22 08:43 ./
drwxr-xr-x 1 user user 418 Nov 22 08:44 ../
-rw-r--r-- 1 user user 7346 Nov 22 08:43 archive_util.py
-rw-r--r-- 1 user user 19539 Nov 22 08:43 build_meta.py
-rw-r--r-- 1 user user 65536 Nov 22 08:43 cli-32.exe
-rw-r--r-- 1 user user 74752 Nov 22 08:43 cli-64.exe
-rw-r--r-- 1 user user 137216 Nov 22 08:43 cli-arm64.exe
-rw-r--r-- 1 user user 65536 Nov 22 08:43 cli.exe
drwxr-xr-x 1 user user 672 Nov 22 08:43 command/
drwxr-xr-x 1 user user 200 Nov 22 08:43 config/
-rw-r--r-- 1 user user 5499 Nov 22 08:43 depends.py
-rw-r--r-- 1 user user 218 Nov 22 08:43 _deprecation_warning.py
-rw-r--r-- 1 user user 949 Nov 22 08:43 dep_util.py
-rw-r--r-- 1 user user 20799 Nov 22 08:43 discovery.py
-rw-r--r-- 1 user user 45578 Nov 22 08:43 dist.py
drwxr-xr-x 1 user user 842 Nov 22 08:43 _distutils/
-rw-r--r-- 1 user user 1972 Nov 22 08:43 _entry_points.py
-rw-r--r-- 1 user user 2464 Nov 22 08:43 errors.py
-rw-r--r-- 1 user user 5591 Nov 22 08:43 extension.py
drwxr-xr-x 1 user user 44 Nov 22 08:43 extern/
-rw-r--r-- 1 user user 4873 Nov 22 08:43 glob.py
-rw-r--r-- 1 user user 65536 Nov 22 08:43 gui-32.exe
-rw-r--r-- 1 user user 75264 Nov 22 08:43 gui-64.exe
-rw-r--r-- 1 user user 137728 Nov 22 08:43 gui-arm64.exe
-rw-r--r-- 1 user user 65536 Nov 22 08:43 gui.exe
-rw-r--r-- 1 user user 1311 Nov 22 08:43 _importlib.py
-rw-r--r-- 1 user user 2392 Nov 22 08:43 _imp.py
-rw-r--r-- 1 user user 8429 Nov 22 08:43 __init__.py
-rw-r--r-- 1 user user 3824 Nov 22 08:43 installer.py
-rw-r--r-- 1 user user 675 Nov 22 08:43 _itertools.py
-rw-r--r-- 1 user user 812 Nov 22 08:43 launch.py
-rw-r--r-- 1 user user 1210 Nov 22 08:43 logging.py
-rw-r--r-- 1 user user 4857 Nov 22 08:43 monkey.py
-rw-r--r-- 1 user user 47724 Nov 22 08:43 msvc.py
-rw-r--r-- 1 user user 3093 Nov 22 08:43 namespaces.py
-rw-r--r-- 1 user user 40329 Nov 22 08:43 package_index.py
-rw-r--r-- 1 user user 749 Nov 22 08:43 _path.py
-rw-r--r-- 1 user user 245 Nov 22 08:43 py34compat.py
drwxr-xr-x 1 user user 1472 Nov 22 08:43 __pycache__/
-rw-r--r-- 1 user user 501 Nov 22 08:43 _reqs.py
-rw-r--r-- 1 user user 14348 Nov 22 08:43 sandbox.py
-rw-r--r-- 1 user user 218 Nov 22 08:43 script (dev).tmpl
-rw-r--r-- 1 user user 138 Nov 22 08:43 script.tmpl
-rw-r--r-- 1 user user 941 Nov 22 08:43 unicode_utils.py
drwxr-xr-x 1 user user 286 Nov 22 08:43 _vendor/
-rw-r--r-- 1 user user 144 Nov 22 08:43 version.py
-rw-r--r-- 1 user user 8376 Nov 22 08:43 wheel.py
-rw-r--r-- 1 user user 718 Nov 22 08:43 windows_support.py
Is there a possibility because of my previous failed installation in the system to now fail compile the code? If so is there anything that can be done?
On your last run, it looks like possibly wxWidgets did not compile properly. It is indeed possible that a previous failed installation could be causing a problem. You might try clearing your pip cache, although I’m not sure exactly how to do that.
Yes I suppose wxWidgets is the package that did not compile correctly. Though I found it on YaST and installed it altogether. The result in this venv of python is the same. It always fails on [11/937].
Trying to “clean” pip on my local account seems dangerous as I have read on the net.
Just for clarity, I stopped trying to build with python3 and went back to python 2.7 interpreter since the displayCAL program requested from the beginning of their documentation that it requires python 2.7. I used wxPython 4.1.0