This is a test version of Biostars. For the public version, visit https://www.biostars.org.
macs2 conda installation problem

Hi,

I am trying to install Macs2 on my Mac using bioconda. However I get the following error:

Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:

  • macs2 -> python[version='>=2.7,<2.8.0a0'] -> *[track_features=debug]
  • python=3

Use "conda info <package>" to see the dependencies for each package.

I have both Python 2.7 and Python3 on my computer. Seems that maybe condo is seeing Python3, then refusing to install since Macs2 only works with Python 2.7. Anyone know if this is something I can fix by changing PATH to Python, or somehow making Python2.7 the default that condo sees?

Thanks,

software error python version macs2 osx

On my linux(ubuntu 16.04) I usually change the defualt python version by adding

alias python='python2'

this line at the start of .bashrc file present in the home directory.

And if I want to use the syatem's python instead of conda, I will change the $PATH variable added by conda from

export PATH=/home/anaconda/bin/:$PATH

To

export PATH=$PATH:/home/anaconda/bin/

In .bashrc file.

Thanks for replying, but modifying the bash file didn't work.

I think you need to source the .bashrc file after adding those lines or you can simply restart the session(terminal).

And one more tip just run

which python2
commamd and set the PYTHONPATH variable as mentioned here

Thank you.

PYTHONPATH is no longer relevant when installing via conda

3 answers

You can use conda to create a virtual environment with the appropriate python version.

It is unadvisable to manipulate system python binaries (particularly on Mac), so Wouter’s answer is absolutely the way to go.

Worked Wouter! Thanks!

sudo pip install MACS2 This should be able to install macs2. Please update following before trying:

1) pip install --upgrade pip 2) pip install numpy 3) pip install --upgrade numpy

Cheers !!

That was going smoothly until I got this error:

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-zj61p_t2/MACS2/

Do yourself a favor and use the virtual environment solution that Wouter suggested above. It is super-wasy to set up and simply typing source activate your-python2-environment is sufficient to activate it. That way you avoid messing around your two python versions that might do conflicting things plus additionally the use of both pip and conda which might cause trouble as well.

In addition to Wouter's answer, you can use virtualenv to install MACS2:

# If virtualenv is not installed
#pip install virtualenv
virtualenv -p python2 ~/bin/MACS2
source ~/bin/MACS2/bin/activate
pip install numpy
pip install macs2

Log in to answer this question.