Phoenix icon indicating copy to clipboard operation
Phoenix copied to clipboard

wxPython 4.0.7 fails to install with missing file error

Open lightspot21 opened this issue 4 years ago • 20 comments

Operating system: Manjaro i3 20.0.3 wxPython version & source: 4.0.7, from PyPI Python version & source: 3.8, from distro (in a venv)
Description of the problem: When attempting to install using poetry install the install cannot complete and this error is thrown (happens also when attempting to install with pip install wxPython==4.0.7 in a clean venv without poetry):

    copying symlink wx/libwx_baseu-3.0.so -> build/lib.linux-x86_64-3.8/wx/libwx_baseu-3.0.so
    error: [Errno 2] No such file or directory: 'build/lib.linux-x86_64-3.8/wx/libwx_baseu-3.0.so

Thanks in advance.

lightspot21 avatar Aug 13 '20 17:08 lightspot21

You're going to need to provide the entire log file for the installation.

swt2c avatar Aug 13 '20 20:08 swt2c

Here it is (it's quite big, 2 MB of errors) error.log

lightspot21 avatar Aug 14 '20 14:08 lightspot21

Very strange. I thought there would be a problem earlier in the log, but there wasn't. It seems that the installation can't create a broken symlink for some reason. Can you try this on your system?

mkdir testdir
ln -s testfile1 testdir/testfile2

swt2c avatar Aug 14 '20 15:08 swt2c

Just tried it. No errors, but when attempting to ls the broken symlink is nowhere to be found. Inside testdir the symlink is visible and clearly marked as broken, like so:

image

lightspot21 avatar Aug 14 '20 15:08 lightspot21

OK that seems to be working as expected. Thanks.

swt2c avatar Aug 14 '20 16:08 swt2c

What filesystem is this on? Specifically, what filesystem is /tmp on?

swt2c avatar Aug 14 '20 16:08 swt2c

Here's the output of df -T:

[lightspot21@Workbox-MK2 ~]$ df -T /tmp
Filesystem     Type   Size  Used Avail Use% Mounted on
tmpfs          tmpfs  3,9G   44M  3,8G   2% /tmp

So it's tmpfs.

lightspot21 avatar Aug 14 '20 22:08 lightspot21

This is very very strange. I'm still scratching my head about it. It seems that you're not the only one, though: https://stackoverflow.com/questions/61390486/wxpython-installation-failure

swt2c avatar Aug 14 '20 23:08 swt2c

The only other thing I can think of - what language and locale do you have your system set to?

swt2c avatar Aug 15 '20 01:08 swt2c

[lightspot21@Workbox-MK2 ~]$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=el_GR.UTF-8
LC_TIME=el_GR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=el_GR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=el_GR.UTF-8
LC_NAME=el_GR.UTF-8
LC_ADDRESS=el_GR.UTF-8
LC_TELEPHONE=el_GR.UTF-8
LC_MEASUREMENT=el_GR.UTF-8
LC_IDENTIFICATION=el_GR.UTF-8
LC_ALL=

lightspot21 avatar Aug 19 '20 19:08 lightspot21

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/pip-install-wxpython-failed/34925/4

RobinD42 avatar Oct 06 '20 16:10 RobinD42

ran into the same issue. this is related to setuptools. i had a version greater 50 installed. i removed it and installed version 41.0.1. This works.

jensgoe avatar Oct 28 '20 10:10 jensgoe

@jensgoe, that's it! I upgraded setuptools before trying to install wxPython and now I can reproduce this. Thanks for that.

swt2c avatar Oct 29 '20 15:10 swt2c

@swt2c I can confirm it works, thank you! (at least for this specific version, haven't checked others) Still, weird that it breaks if the version of setuptools changes. Also paging @RobinD42

lightspot21 avatar Oct 31 '20 19:10 lightspot21

So, I think the cause is this change in setuptools: https://github.com/pypa/setuptools/commit/70e95ee66a17e1655f70c9dbda107cea958f583f

When copying files and the file is a broken symlink (because the target hasn't been copied yet), make_writable will fail because os.stat() by default follows symlinks and since the target doesn't yet exist, it returns a file not found error.

The reason this isn't a problem in 4.1.0 is that Robin has monkey patched make_writable to work around this problem: https://github.com/wxWidgets/Phoenix/commit/aa8430ad391d93391988451f43ecedd76ca4dd77

I wonder though if this change to make_writable can/should be upstreamed in setuptools.

swt2c avatar Nov 02 '20 01:11 swt2c

Same issue here on Mageia 8 no solution or workaround found so far

thetuxinator avatar Jan 06 '22 08:01 thetuxinator

Same issue here on Mageia 8 no solution or workaround found so far

Did you try downgrading setuptools to ~41?

swt2c avatar Jan 06 '22 13:01 swt2c

I ran into the same issue: downgraded setuptools and it worked

michael-camilleri avatar Feb 04 '22 18:02 michael-camilleri

Hi, I have the same issue now. And downgrading setuptools to version 41.0.1 did not help. Any suggestions?

kpnivya avatar Sep 07 '22 02:09 kpnivya

Can confirm this for Debian 11 as well. Cannot install this with poetry add.

ChauhanT avatar Sep 12 '22 22:09 ChauhanT