Skip to content

Fix issues when installing ete4 on Windows.#783

Open
ArnaudBelcour wants to merge 2 commits into
etetoolkit:ete4from
ArnaudBelcour:ete4
Open

Fix issues when installing ete4 on Windows.#783
ArnaudBelcour wants to merge 2 commits into
etetoolkit:ete4from
ArnaudBelcour:ete4

Conversation

@ArnaudBelcour
Copy link
Copy Markdown

Hi,

I am using GitHub Actions to test tools on Windows. Since I have modified these tools to use ete4, there is an issue with the Windows build when it tries to install ete4 using pip (error encountered with ete4 4.1.1 and 4.3.0). It happens during the compilation by Cython of ete4. But it is not happening with Ubuntu or macOS builds.

You can find a full traceback of this error here.

After several tests, I found that the error comes from the separator used in the setup.py file:
https://github.com/etetoolkit/ete/blob/ete4/setup.py#L10

Indeed, the / works for Ubuntu and macOS, but for Windows it is not correct and leads to errors. So I created this PR to fix this and use os.path.sep instead to specify the path separator and to have the correct one for Windows.

Also, I implement the fix proposed in #763, to solve KeyError issue on Windows.

With these two changes, ete4 was installed correctly on Windows, on different runs:
https://github.com/AuReMe/metage2metabo/actions/runs/15068672311
https://github.com/AuReMe/emapper2gbk/actions/runs/15069612333

Best regards,
Arnaud Belcour.

@yudalang3
Copy link
Copy Markdown

Yes, it is a great progress, any managers could handle this ?

@yudalang3
Copy link
Copy Markdown

@jordibc @ArnaudBelcour @idoerg @fransua Can you hearing me ? There enhancement is very important.

@yudalang3
Copy link
Copy Markdown

I also give PR for this issue, the solution is equal and modify some annotations and configuration. see #793

@Changwanseo
Copy link
Copy Markdown

Changwanseo commented May 8, 2026

+1 — tested this PR on Windows 11 (Python 3.11, MSVC Build Tools).

Without the patch, pip install ete4 from the PyPI sdist fails with 'ete4\core\operations' is not a valid module name because glob('**/*.pyx', recursive=True) returns \-separated paths that Cython rejects as module names.

With this PR applied (via pip install git+https://github.com/etetoolkit/ete.git@refs/pull/783/head), the sdist builds cleanly to a cp311-cp311-win_amd64 wheel and installs without errors. from ete4 import Tree works, basic tree parsing and rerooting operations function normally.

A note on the related PR #793: it carries the same setup.py fix, but the rest of that branch leaves a stray from .py4egps_treeview import * in ete4/__init__.py which raises ModuleNotFoundError immediately on import — so #793 isn't mergeable as-is. #783 is the cleaner change and the one I'd recommend merging.

@jordibc, @fransua — would really appreciate a review. There's currently no working pip install ete4 path on Windows from PyPI.

  • Comment drafted with Claude's help for language support; the testing and results are mine.

Sincerely,

Chang Wan Seo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants