AndersenLab / VCF-kit

VCF-kit: Assorted utilities for the variant call format
http://www.andersenlab.org
MIT License
122 stars 25 forks source link

pip install fail #6

Closed hoyonh closed 7 years ago

hoyonh commented 7 years ago

I couldn't install by pip install. Any suggestions or alternatives? Here are some of the error messages I saw.

[at the end] Command "/Users/hoyon/miniconda3/bin/python3 -u -c "import setuptools, tokenize;file='/private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-i96np5eh/biopython/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-n4dr4h_m-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-i96np5eh/biopython/

[other error messages] Building wheels for collected packages: biopython Running setup.py bdist_wheel for biopython ... error Complete output from command /Users/hoyon/miniconda3/bin/python3 -u -c "import setuptools, tokenize;file='/private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-i96np5eh/biopython/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/tmpzjq85embpip-wheel- --python-tag cp34:

-- skipped --

gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Qunused-arguments -Qunused-arguments -I/Users/hoyon/miniconda3/include/python3.4m -c Bio/cpairwise2module.c -o build/temp.macosx-10.5-x86_64-3.4/Bio/cpairwise2module.o gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? error: command 'gcc' failed with exit status 1


Failed building wheel for biopython

... FWIW, I recently replaced the default gcc (Clang) with gcc (Stacks 6.2) as instructed below. Could this be the problem? http://gbs-cloud-tutorial.readthedocs.io/en/latest/03_computer_setup.html

danielecook commented 7 years ago

Hi @hoyonh sorry for the delay I was out of town. I'm not sure VCF-kit is compatible with python3 yet (although I am trying to get there). I recommend using python 2.7 for now.

hoyonh commented 7 years ago

I downgraded to python 2.7 (2.7.13 to be precise). It still doesn't work. I tried multiple times. First time, I got this message.

Collecting yahmm (from VCF-kit) Using cached yahmm-1.1.3.zip Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-eW2412/yahmm/setup.py", line 3, in import numpy as np ImportError: No module named numpy

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-eW2412/yahmm/

So, I reinstalled numpy once again - by pip install. After a while, I also reinstalled yahmm (no need to matplotlib). After all that, I get these messages.

gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Qunused-arguments -Qunused-arguments -I/Users/hoyon/miniconda3/include/python2.7 -c Bio/cpairwise2module.c -o build/temp.macosx-10.7-x86_64-2.7/Bio/cpairwise2module.o gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? error: command 'gcc' failed with exit status 1


Failed building wheel for biopython Running setup.py clean for biopython Failed to build biopython Installing collected packages: MarkupSafe, jinja2, args, clint, biopython, tabulate, sortedcontainers, intervaltree, VCF-kit Running setup.py install for biopython ... error

... skip ...

gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Qunused-arguments -Qunused-arguments -I/Users/hoyon/miniconda3/include/python2.7 -c Bio/cpairwise2module.c -o build/temp.macosx-10.7-x86_64-2.7/Bio/cpairwise2module.o gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-argument’? error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/Users/hoyon/miniconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-sEjKyc/biopython/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-Na38pi-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/q3/_06d0ck94zj4c_l7nmk0r9_00000gn/T/pip-build-sEjKyc/biopython/

danielecook commented 7 years ago

Looks like an issue with the compiler.

Try: xcode-select install and update to the latest version of command line tools.

Also if you are using homebrew you can try: brew install gcc

hoyonh commented 7 years ago

First was done already. I tried the latter (re-install gcc) - it required

brew link --overwrite gmp brew link --overwrite mpfr

In any case, after all that, I still get the same error messages.

If I do gcc --version, I get this in case it helps.

Ho-Yons-MacBook-Pro:~ hoyon$ gcc --version gcc (GCC) 6.2.0 Copyright (C) 2016 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

danielecook commented 7 years ago

hmm, I'm not sure. Try:

brew unlink gcc and then do gcc --version

I have this:

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

What version of OSX do you have?

It looks like things are getting hung up on biopython. Do any of the following not work?

pip install numpy
pip install biopython
pip install cyvcf2
hoyonh commented 7 years ago

I see. I wrote in the OP that I was using Stacks not Clang -- because I was trying to get something else (fastStructure) to work -- not that Stacks solved the problem with fastStructure install.

I'm going to see if there's a way to reinstall Clang ...

danielecook commented 7 years ago

I'm pretty sure xcode installs it.

hoyonh commented 7 years ago

xcode-select --install xcode-select: error: command line tools are already installed, use "Software Update" to install updates

sudo xcode-select --reset didn't change anything

brew install gcc47 ...stuff Error: The brew link step did not complete successfully The formula built, but is not symlinked into /usr/local

hoyonh commented 7 years ago

maybe I should do a fresh install of OS ... simplest would be to upgrade to Sierra

danielecook commented 7 years ago

Don't do that just yet. I would try a fresh install of homebrew first.

danielecook commented 7 years ago

So delete homebrew entirely and reinstall

hoyonh commented 7 years ago

ok. how do I delete homebrew?

danielecook commented 7 years ago

https://github.com/Homebrew/install

hoyonh commented 7 years ago

Okay - tried uninstall and re-install. Then checked gcc --version - no change.

danielecook commented 7 years ago

Which python are you using? I recommend using pyenv (this also integrates with virtualenv)

You should be able to run something like:

brew install pyenv
pyenv install 2.7.11
pip install --upgrade pip
pip install vcf-kit

Be sure to add the following to your bash profile (be sure this matches brew output):

export PYENV_ROOT=/usr/local/var/pyenv
if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
hoyonh commented 7 years ago

$ python --version Python 2.7.13 :: Continuum Analytics, Inc.

danielecook commented 7 years ago

I'm not 100% familiar with bioconda, but perhaps you can install biopython with it and try moving forward that way? https://anaconda.org/anaconda/biopython

conda install -c anaconda biopython=1.68
hoyonh commented 7 years ago

after pyenv, etc., same problem (did not change bash profile - yet)

after conda install biopython, it seemed to install.

however, if I type vk setup, I get this. $ vk setup bwa Traceback (most recent call last): File "/Users/hoyon/miniconda3/bin/vk", line 7, in from vcfkit.vk import main File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in from utils.vcf import * File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 1, in from cyvcf2 import VCF as cyvcf2 File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/cyvcf2/init.py", line 1, in from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness, ImportError: No module named cyvcf2

danielecook commented 7 years ago

yes progress! I think you can probably use bioconda for cyvcf2. I'm not sure if that failed or what. Try:

conda install cyvcf2

Also do:

pip install ipython

And try to import it manually:

from cyvcf2 import VCF 

This error does highlight poor renaming of an import. I will try to resolve that soon.

hoyonh commented 7 years ago

pip install ipython appears to have failed. Error messages include gcc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/Users/hoyon/miniconda3/include/python2.7 -c _scandir.c -o build/temp.macosx-10.7-x86_64-2.7/_scandir.o dyld: Library not loaded: /usr/local/lib/libmpc.3.dylib Referenced from: /usr/local/libexec/gcc/x86_64-apple-darwin15.6.0/6.2.0/cc1 Reason: image not found gcc: internal compiler error: Trace/BPT trap: 5 (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html for instructions. error: command 'gcc' failed with exit status 4


Failed building wheel for scandir

...

then $ from cyvcf2 import VCF from: can't read /var/mail/cyvcf2

danielecook commented 7 years ago

that's pretty weird.

danielecook commented 7 years ago

Do you use docker?

hoyonh commented 7 years ago

I don't know what docker is.

I haven't changed bash profile BTW. I don't know how to match to brew output ... much of this is very new to me.

danielecook commented 7 years ago

you don't need to change bash profile unless you intend to use pyenv going forward.

danielecook commented 7 years ago

what is the output when you do pip install cyvcf2

hoyonh commented 7 years ago

OK. I want to head home fairly soon (30+ min drive).

$ pip install cyvcf2 Requirement already satisfied: cyvcf2 in ./miniconda3/lib/python2.7/site-packages Requirement already satisfied: cython>=0.22.1 in ./miniconda3/lib/python2.7/site-packages (from cyvcf2)

danielecook commented 7 years ago

hmmm. Try opening a new (fresh) terminal window and hitting vk

danielecook commented 7 years ago

Hey @hoyonh shoot me an email. You can find it on my personal website (danielecook.com). I do want to help you get this resolved. We can take a look tomorrow.

hoyonh commented 7 years ago

same message about cyvcf2. Yeah - I'll e-mail you tomorrow.

hoyonh commented 7 years ago

upgrade to Sierra may very well be the simplest solution as I cannot switch back to Clang thus far (I tried a few methods I found online).

danielecook commented 7 years ago

Okay give that a go and let me know if it doesn't work. Sorry for the issues you are having.

On Wed, Feb 22, 2017 at 10:27 PM, hoyonh notifications@github.com wrote:

upgrade to Sierra may very well be the simplest solution as I cannot switch back to Clang thus far (I tried a few methods I found online).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AndersenLab/VCF-kit/issues/6#issuecomment-281891488, or mute the thread https://github.com/notifications/unsubscribe-auth/ABdzp4iRMPM6h4w6mH_8LocUWnkr6mZTks5rfQrKgaJpZM4MEn_z .

-- Daniel Cook

hoyonh commented 7 years ago

I managed to switch back to the Clang version of gcc - without moving to Sierra (it had something to do with a modified .bashrc file - having to do with that fastStructure install fiasco I mentioned). With this out of the way, I was able to pip install ipython. However, other parts were not working so I checked other stuff - found that conda install cyvcf2 wasn't working.

$ conda install cyvcf2 Fetching package metadata .........

PackageNotFoundError: Package not found: '' Package missing in current osx-64 channels:

You can search for packages on anaconda.org with

anaconda search -t conda cyvcf2

...

doing anaconda search -t conda cyvcf2 $ anaconda search -t conda cyvcf2 Using Anaconda API: https://api.anaconda.org Run 'anaconda show <USER/PACKAGE>' to get more details: Packages: Name Version Package Types Platforms
bioconda/cyvcf2 0.6.6a conda linux-64, osx-64
                                      : A cython wrapper around htslib built for fast parsing of Variant Call Format (VCF) files

Found 1 packages

... but I wasn't able to do much with this information (e.g. couldn't do conda install bioconda (or bioconda/cyvcf2)) ...

I tried pip install cyvcf2

$ pip install cyvcf2 Requirement already satisfied: cyvcf2 in ./miniconda3/lib/python2.7/site-packages Requirement already satisfied: cython>=0.22.1 in ./miniconda3/lib/python2.7/site-packages (from cyvcf2)

...

So maybe I don't need to install cyvcf2? However ...

$ from cyvcf2 import VCF from: can't read /var/mail/cyvcf2

so that does not seem to be working... and I still get $ vk Traceback (most recent call last): File "/Users/hoyon/miniconda3/bin/vk", line 7, in from vcfkit.vk import main File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/vcfkit/vk.py", line 27, in from utils.vcf import * File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/vcfkit/utils/vcf.py", line 1, in from cyvcf2 import VCF as cyvcf2 File "/Users/hoyon/miniconda3/lib/python2.7/site-packages/cyvcf2/init.py", line 1, in from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness, ImportError: No module named cyvcf2

Thanks very much for your help by the way.

danielecook commented 7 years ago

ah okay, it doesn't look like you'll be able to install cyvcf2 with conda.

Try:

pip uninstall cyvcf2
pip install cyvcf2 --no-cache-dir
hoyonh commented 7 years ago

That worked! Thanks very much!

I may send you an e-mail for questions about using this program (e.g. which command(s) to make nexus file).

PallawiSinghal commented 5 years ago

python setup.py build_ext --inplace running build_ext building 'pycocotools._mask' extension cc -pthread -DNDEBUG -g -O3 -Wall -Qunused-arguments -Qunused-arguments -fPIC -I/home/arya/workspace/Auto_insure/autoi/lib/python3.7/site-packages/numpy/core/include -I../common -I/home/linuxbrew/.linuxbrew/Cellar/python/3.7.1/include/python3.7m -c pycocotools/_mask.c -o build/temp.linux-x86_64-3.7/pycocotools/_mask.o cc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’? cc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’? error: command 'cc' failed with exit status 1 Makefile:3: recipe for target 'all' failed make: *** [all] Error 1

I am getting this error can u please help me?

danielecook commented 5 years ago

@PallawiSinghal I recommend you try using anaconda to install.

Also - you are using Python 3.7 but this is only compatible with Python 2.7 at the moment.