Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird installation errors on Mac (humann2 and metaphlan2) #18

Closed
kescobo opened this issue Mar 2, 2018 · 8 comments
Closed

Weird installation errors on Mac (humann2 and metaphlan2) #18

kescobo opened this issue Mar 2, 2018 · 8 comments

Comments

@kescobo
Copy link

kescobo commented Mar 2, 2018

Metaphlan2

$ brew install metaphlan2
==> Installing metaphlan2 from biobakery/biobakery
==> Downloading http://huttenhower.sph.harvard.edu/metaphlan2_downloads/metaphlan2-2.6.0.tar.gz
######################################################################## 100.0%
Please install python2
$ python --version
Python 2.7.10
$ python2 --version
Python 2.7.14

For the record, Mac OSX has python 2.7 installed as part of the system software, so all OSX installations should have it. I also have an additional python2 installed through homebrew, but I tried this on a system that doesn't, and got the same message.

Humann2

$ brew install humann2
Error: Formulae found in multiple taps:
       * biobakery/biobakery/humann2
       * brewsci/science/humann2

Please use the fully-qualified name e.g. biobakery/biobakery/humann2 to refer the formula.
$ brew install biobakery/biobakery/humann2
==> Installing humann2 from biobakery/biobakery
==> Installing dependencies for biobakery/biobakery/humann2: biobakery/biobakery/metaphlan2
==> Installing biobakery/biobakery/humann2 dependency: biobakery/biobakery/metaphlan2
==> Downloading http://huttenhower.sph.harvard.edu/metaphlan2_downloads/metaphlan2-2.6.0.tar.gz
Already downloaded: /Users/kev/Library/Caches/Homebrew/metaphlan2-2.6.0.tar.gz
Please install python2

The one in brewsci/science seems to work for both humann2 and (because it's installed as a dependency) metaphlan2. Though I think it's installing the python3 version.

@ljmciver
Copy link
Member

ljmciver commented Mar 5, 2018

Hi Kevin,

Can you run the following two commands and see what you get?
$ python2 --version 2>&1
$ echo $?

The error message you are seeing gets triggered from a non-zero exit code when running the first command.

The python2 is used to differentiate between python2 and 3. Linux has both installed plus "python" which I have always seen point to python2. There was a MacOS user in the lab that had installed python and it pointed to python3 which is why we have "python2". It sounded like this was common but maybe your setup is more common (python points to python2 on Mac)? I am sorry I don't have a Mac so am not able to debug default installations.

Thanks,
Lauren

@kescobo
Copy link
Author

kescobo commented Mar 6, 2018

$ python2 --version 2>&1
Python 2.7.14
$ echo $?
0

@ljmciver
Copy link
Member

ljmciver commented Mar 6, 2018

Hi Kevin - Thanks for checking. I think it is either one of two things: 1) you might have a slightly different version of ruby so the return code check does not operate the same way as I have seen it in linux 2) the homebrew formulas pick up a different python in your $PATH and it has a different return code. For the first possibility I modified the check to make it as specific as possible. The prior version and current version both operate as expected on linux. If you can try the latest version of the formulas maybe they will work with your configuration. If not, the next step would be to check the exact python the formulas are calling and what ruby gets for a return code.

Thanks,
Lauren

@kescobo
Copy link
Author

kescobo commented Mar 12, 2018

$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

For what it's worth, I've tried this now on several different Macs, including those with only the default python 2.7 install, and I've had the same error on all of them.

@kescobo
Copy link
Author

kescobo commented Mar 12, 2018

I just tried again with the new formula, still no go. Also, attempted to install with the option --with-python3, and after installing a few things:

==> python3 -c import setuptools... --no-user-cfg install --prefix=/usr/local/Cellar/metaphlan2/2.6.0/libexec --single-version-externally-managed
Last 15 lines from /Users/kev/Library/Logs/Homebrew/metaphlan2/04.python3:
building 'dfftpack' library
Running from scipy source directory.
/usr/local/Cellar/metaphlan2/2.6.0/libexec/lib/python3.6/site-packages/numpy/distutils/system_info.py:564: UserWarning:
    UMFPACK sparse solver (http://www.cise.ufl.edu/research/sparse/umfpack/)
    not found. Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [umfpack]) or by setting
    the UMFPACK environment variable.

@ljmciver
Copy link
Member

Hi Kevin - It looks like the install is having issues with installing scipy from source. There are options in the humann2/metaphlan2 formulas to bypass installing the python dependencies (ie numpy/scipy/matplotlib). The option is "--without-dependencies". Would you try installing with this option and then manually installing numpy/others with commands like "brew install numpy" (or you might already have them installed). This way you can use the brew bottles if available for your OS instead of having to install from source. The only downside is you will likely install newer versions of the dependencies than those tested with humann2/metaphlan2. The only issue I know of is that the latest scipy operates differently for normalization so you could see an error message when running humann2_barplot. We plan to have this addressed in the next release of humann2. Let me know if this resolves your issue and I will close the ticket.

Thanks,
Lauren

@kescobo
Copy link
Author

kescobo commented Apr 17, 2018

@ljmciver That worked for metaphlan2.

But now humann2 is getting a different error (before it was failing on the metaphlan2 install step). This was also solved by using the --without-dependencies flag:

$ brew install biobakery/biobakery/humann2
==> Installing humann2 from biobakery/biobakery
==> Downloading https://pypi.python.org/packages/43/07/ec41577c3c1f9b578875ade8ed549d14fc2944c13cb7504579d542b62a69/humann2-0.11.1.tar.gz
==> Downloading from https://pypi.org/packages/43/07/ec41577c3c1f9b578875ade8ed549d14fc2944c13cb7504579d542b62a69/humann2-0.11.1.tar.gz
######################################################################## 100.0%
==> Downloading https://pypi.python.org/packages/67/ab/41e4b42e0519d868347d2cf1051a05ce0170632039c053dee8ffe8b43b0b/numpy-1.8.2.tar.gz
==> Downloading from https://pypi.org/packages/67/ab/41e4b42e0519d868347d2cf1051a05ce0170632039c053dee8ffe8b43b0b/numpy-1.8.2.tar.gz
######################################################################## 100.0%
==> python2 -c import setuptools... --no-user-cfg install --prefix=/usr/local/Cellar/humann2/0.11.1/libexec --single-version-externally-managed --record=install
Last 15 lines from /Users/kev/Library/Logs/Homebrew/humann2/01.python2:
  File "/private/tmp/humann2--numpy-20180417-26305-17d9ziu/numpy-1.8.2/numpy/distutils/command/build_src.py", line 153, in run
    self.build_sources()
  File "/private/tmp/humann2--numpy-20180417-26305-17d9ziu/numpy-1.8.2/numpy/distutils/command/build_src.py", line 170, in build_sources
    self.build_extension_sources(ext)
  File "/private/tmp/humann2--numpy-20180417-26305-17d9ziu/numpy-1.8.2/numpy/distutils/command/build_src.py", line 329, in build_extension_sources
    sources = self.generate_sources(sources, ext)
  File "/private/tmp/humann2--numpy-20180417-26305-17d9ziu/numpy-1.8.2/numpy/distutils/command/build_src.py", line 386, in generate_sources
    source = func(extension, build_dir)
  File "numpy/core/setup.py", line 428, in generate_config_h
    moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
  File "numpy/core/setup.py", line 42, in check_types
    out = check_types(*a, **kw)
  File "numpy/core/setup.py", line 289, in check_types
    "Cannot compile 'Python.h'. Perhaps you need to "\
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

@ljmciver
Copy link
Member

Hi Kevin - Glad it sounds like it is working. Please reopen this ticket if there is another outstanding issue that I have not yet addressed. Another option for the humann2 Python.h error would be to uninstall/reinstall python as it looks like it can't find its header files.

Thanks,
Lauren

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

No branches or pull requests

2 participants