Coder Social home page Coder Social logo

Install fails on M1 macs about pertpy HOT 18 CLOSED

theislab avatar theislab commented on June 1, 2024 1
Install fails on M1 macs

from pertpy.

Comments (18)

Zethson avatar Zethson commented on June 1, 2024 2

@Moomboh thank you very much for your in depth response.

Yes, please open a separate issue for this. I'd also be happy to get a PR in with your suggested improvement and we can discuss it directly there!

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024 1

Prior to installing pertpy, install Qt5 via brew (and follow the directions to add to path), restart terminal, then run:
pip install pyqt5 --config-settings --confirm-license= --verbose

Then pip install pertpy works

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

@xinyuejohn you're using a M1 right? Got any idea?

from pertpy.

stefanpeidli avatar stefanpeidli commented on June 1, 2024

Note: conda install -c anaconda pyqt will lead to a version below the one required by pertpy (5.5.12 < 5.5.17).

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024

Accidentally closed when trying to add additional issue:

Setting up developer environment as described here

At the make install step I get

` • Installing pyqt5-qt5 (5.15.2): Failed

RuntimeError

Unable to find installation candidates for pyqt5-qt5 (5.15.2)
`

Installing pyqt5 separately as described above does not fix.

`make install
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '.egg-info' -exec rm -fr {} +
find . -name '
.egg' -exec rm -f {} +
find . -name '.pyc' -exec rm -f {} +
find . -name '
.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name 'pycache' -exec rm -fr {} +
poetry install
Installing dependencies from lock file

Package operations: 51 installs, 0 updates, 0 removals

• Installing pyqt5-qt5 (5.15.2): Failed

RuntimeError

Unable to find installation candidates for pyqt5-qt5 (5.15.2)

at ~/miniforge3/envs/pertpy-distances/lib/python3.9/site-packages/poetry/installation/chooser.py:105 in choose_for
101│
102│ links.append(link)
103│
104│ if not links:
→ 105│ raise RuntimeError(f"Unable to find installation candidates for {package}")
106│
107│ # Get the best link
108│ chosen = max(links, key=lambda link: self._sort_key(package, link))
109│

make: *** [install] Error 1`

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024

pip install PyQt5-Qt5 ERROR: Could not find a version that satisfies the requirement PyQt5-Qt5 (from versions: none) ERROR: No matching distribution found for PyQt5-Qt5

Not sure where to go from here @Zethson -- we considered removing the requirement from our branch but we're not sure where it's coming from in the first place

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

It's from ipykernel I think

from pertpy.

xinyuejohn avatar xinyuejohn commented on June 1, 2024

@xinyuejohn you're using a M1 right? Got any idea?

Sorry for the late reply. I am using Mac with intel i5.

from pertpy.

Moomboh avatar Moomboh commented on June 1, 2024

The problematic pyqt5 dependency is required by ete3, see https://github.com/etetoolkit/ete/blob/master/setup.py#L81
It is required by pertpy here, probably because ete3 depends on it. I believe for ipykernel it is just an optional dependency.

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

@Moomboh Indeed. ete3 requires it for plotting. So I'll need to make these dependencies optional urgh.

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

If I did things correctly, ete3 and pyqt5 should now be optional dependencies. @tessadgreen can you please test the latest development branch?

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

Apparently people are working on it etetoolkit/ete#656

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024

Installing from the latest development branch following the directions in the Contributor Guide works, and I'm seeing the 'ete3' warning on import. Nox runs successfully and I'm able to import pertpy into python.

Should note that the Qt5 brew install was system wide so it is available in the new environment for me/I don't know if it now works without that step.

from pertpy.

Moomboh avatar Moomboh commented on June 1, 2024

Can confirm that setting up dev environment according to the Contributor Guide also works for me on Apple Silicon.
I also have qt5 installed system wide via brew install qt5 which might be an requirement.

Though to get nox to run I had to do:

poetry run pip install nox nox-poetry
poetry run nox

I also managed to get pertpy running including rtools support and ete3 running on Apple Silicon:

  1. Install qt5 via homebrew:

    brew install qt5

    Make sure to add all the environment variables to your ~/.zshrc as described at the end of the output of the brew install command then reload your shell:

    zsh
  2. Create environment with mamba (conda should work as well, but I haven't tested it):

    # environment.yaml
    name: pertpy-apple-silicon
    channels:
      - conda-forge
    dependencies:
      - python=3.9
      - rpy2
    mamba create -f environment.yaml -n pertpy-apple-silicon
    mamba activate pertpy-apple-silicon
  3. Install pyqt5 via pip in conda enviroment:

    pip install pyqt5 --config-settings --confirm-license= --verbose

    This needs to be compiled from sources so this might take quite a while

  4. Install ete3 via pip:

    pip install ete3
  5. Finally install pertpy nightly via pip:

    pip install git+https://github.com/theislab/pertpy.git

(As of this writing nightly was at theislab/pertpy@3e6a702)

Now pertpy should be working fine and you should be able to use all features 🎉

import pertpy as pt

I still get the ete3 warning on import, but I think this is due to a bug in pertpy/tools/init.py#L10
There are faulty import paths getting masked by the catching of the ImportError for the ete3 warning.
from pertpy.tools.coda._sccoda import Sccoda works fine.

I think pertpy/tools/init.py#L10 should be instead:

try:
    from pertpy.tools.coda._sccoda import Sccoda
    from pertpy.tools.coda._tasccoda import Tasccoda
except ImportError as e:
    if "ete3" in str(e):
        print(
            "[bold yellow]To use sccoda or tasccoda please install ete3 with `pip install ete3`"
        )
    else:
        raise e

@Zethson should I open a separate issue for this?

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024

New brew install required by the _dialogue.py. The new linear programming solver requires system-wise ipopt install on Mac, which can be done with brew install ipopt

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

New brew install required by the _dialogue.py. The new linear programming solver requires system-wise ipopt install on Mac, which can be done with brew install ipopt

It should only be required if you try to run DIALOGUE though, right?

Also, ipopt is on conda

from pertpy.

tessadgreen avatar tessadgreen commented on June 1, 2024

Oh, yes sorry this came up when trying to run Dialogue, the install was fine/didn't error and I just had the problem when I tried to run the multifactor PMD with the linear programming addition. I got the error ApplicationError: No executable found for solver 'ipopt' and followed the directions here. Assumed that was the problem I was having but I'm going back through the log now and it looks like ipopt isn't a dependency/wasn't installed by pip and the brew was overkill. Sorry for the confusion!

from pertpy.

Zethson avatar Zethson commented on June 1, 2024

Yeah, I'll write up proper installation instructions soon, sorry.

from pertpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.