etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
773 stars 216 forks source link

Installing ete4 on Apple M1 / Upgrade to PyQt6 #696

Closed sirno closed 10 months ago

sirno commented 12 months ago

Hi,

I've run into substantial trouble installing ete3 as well as ete4 on an Apple M1. The main issue is that only PyQt6 is fully compatible with arm64.

It is possible to install using conda and manually setting the environment to use x86 compiled binaries:

conda create -n ete
conda config --env --set subdir osx-64
conda install python
pip install ...

To install ete4 natively I have created a fork and upgraded it to PyQt6 and some things seem to be working. Maybe the release of ete4 would be a good time to upgrade to PyQt6 as arm64 processors are already quite common.

dengzq1234 commented 12 months ago

Hi! ete3 and ete4 are currently differen in regards to dependency, ete3 requires PyQt and I think PyQt5 should be enough to run it. And in ete4 we no longer need PyQt pacakge, simply try pip install https://github.com/etetoolkit/ete/archive/ete4.zip should work

sirno commented 12 months ago

Hi! Thanks, for the reply. This makes sense and explains why a lot of the qt code and tree data structure looked like they were not in agreement anymore.

Note that pyqt5 is still listed as a requirement on the ete4 branch in the pyproject.toml and thus installation will fail if pyqt5 cannot be installed.

harper357 commented 10 months ago

@dengzq1234 I just tried installiing from the zip you linked and it doesn't work. Also, like sirno said, pyqt5 is still listed as a requirement and there is still a bit of qt imports/code in treeview.

jhcepas commented 10 months ago

yes, pyqt will still be necessary to use the treeview module, which will not be deprecated in version 4. Instead, we are adding a new module (so far named smartview) that provides a fully re-engineered replacement of the drawing engine. So, pyqt would be kind of an optional dependency. We will be very actively working on migrating the documentation to ete4 in the following months, so we can address all these issues.

We will need to get access to an M1 apple computer to verify what's happening, but I think we could do it. aren't there qt5 packages in conda matching M1 architectures? did you try them with ete3?

Compatibility of treeview with of qt6 is still not tested on our side, but will probably require some refactoring.

harper357 commented 10 months ago

Ok, conda does seem to have pyqt5 and it seems to be working. Sorry about that, conda is not my first choice for python and none of the posts about pyqt5 not working on the m1 mentioned conda.

Thanks!

jhcepas commented 10 months ago

good to know! we will offer conda releases of ete4 soon, so this dependencies are automatically met. I am closing this issue unless there are further related problems.

sirno commented 10 months ago

Just to be complete here, pyqt5 is not natively available for m1 / arm64. You can install pyqt5 using conda if you set the subdir config variable in the conda environment to osx-64 which will cause conda to install everything using the x86 instruction set. This will also cause everything else, including python, to be installed non-natively within this environment.

harper357 commented 10 months ago

I am not sure how they did it, but I am running the osx-arm64 version of python/conda. I did not switch anything and everything installed from conda-forge which conda lists pyqt5 as coming from https://conda.anaconda.org/conda-forge/osx-arm64/pyqt5-sip-12.11.0-py39h23fbdae_3.conda and https://conda.anaconda.org/conda-forge/osx-arm64/pyqt-5.15.7-py39h7fba1b6_3.conda