Question: help with MACS2 installation errors
gravatar for g.sathish.k
22 months ago by
g.sathish.k0 wrote:

I have been trying to install macs2 to run some jobs on hpc server, but still failing after multiple attempts to install. I used "pip install MACS2" and this is the error I get:

tommy35@hpc-login3:~/project/NGStools pip install MACS2
Collecting MACS2
Requirement already satisfied: numpy>=1.6 in /auto/rcf-40/tommy35/.local/lib/python2.7/site-packages (from MACS2)
Installing collected packages: MACS2
Traceback (most recent call last):
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/", line 215, in main
    status =, args)
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/commands/", line 342, in run
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/req/", line 784, in install
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/req/", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/req/", line 1064, in move_wheel_files
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/", line 316, in clobber
  File "/home/rcf-40/tommy35/.local/lib/python2.7/site-packages/pip/utils/", line 83, in ensure_dir
  File "/usr/lib64/python2.7/", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/lib64/python2.7/site-packages/MACS2'
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I can't do 'sudo' since I am on hpc and I don't have permission to do that.

Is manually installing MACS2 in my home directory the only option?

Thank you for time and suggestions.

pip install macs2 hpc • 1.7k views
ADD COMMENTlink modified 22 months ago • written 22 months ago by g.sathish.k0

I edited your post to format the output as code. You can do this by either indenting 4 spaces, or highlighting and pressing the code button (the one with the 1010) in the tool bar.

ADD REPLYlink written 22 months ago by i.sudbery10k

Awesome! Thanks so much. I will follow the formatting for my future posts

ADD REPLYlink written 22 months ago by g.sathish.k0
gravatar for i.sudbery
22 months ago by
Sheffield, UK
i.sudbery10k wrote:

You have several options:

1) You could try installing with pip install MACS2 --user

2) You could create a virtual environment and install MACS2 in that with pip install MACS2

3) Download and install conda (which you can do into your home dir) and then install using conda from the bioconda channel.

Personally, if you are on a HPC do bioinformatics I recommend using conda. It will make it easy to install many bioinformatics packages. Whats more, the world is going over to python 3, but MACS2 requires python 2. This isn't a problem at the moment because your HPC appears to default to python2, but this will likely change. With conda, you can give MACS2 its own environment, and keep it, its dependencies, and python 2 isolated from whatever the wider environment is going to is.

However, that might be a big change in how you work and pip install --user MACS2 is simple.

ADD COMMENTlink modified 22 months ago • written 22 months ago by i.sudbery10k

I previously tried "pip install MACS2 --user" and it successfully installed, but couldn't call the package as shown below.

tommy35@hpc-login3:~ pip show macs2
Name: MACS2
Version: 2.1.2
Summary: Model Based Analysis for ChIP-Seq data
Author: Tao Liu
License: UNKNOWN
Location: /auto/rcf-40/tommy35/.local/lib/python2.7/site-packages
Requires: numpy

tommy35@hpc-login3:~ macs2
-bash: macs2: command not found

ThenI added the following to my bashrc file , even though I didn't have to.. And I am still not able to call macs2

export PYTHONPATH=/auto/rcf-40/tommy35/.local/lib/python2.7/site-packages/:$PYTHONPATH
export PATH=$HOME/bin/:$PATH
ADD REPLYlink modified 22 months ago • written 22 months ago by g.sathish.k0

I think pip --user puts the binaries under ~/.local/bin rather than $HOME/bin, so try the following in your .bashrc

export PATH=$HOME/.local/bin:$PATH
ADD REPLYlink written 22 months ago by i.sudbery10k

I didn't try this, but I ended up uninstalling and doing the manual install which was much less work than what I anticipated. I really appreciate your suggestions.

ADD REPLYlink written 22 months ago by g.sathish.k0
gravatar for g.sathish.k
22 months ago by
g.sathish.k0 wrote:

For others running into same issue, if none of the above suggestions work, then try manual installation as shown here :

In short this is how I did,

  1. Add the following into bashrc file

    $ export PYTHONPATH=$HOME/lib/python2.7/site-packages/:$PYTHONPATH

    $ export PATH=$HOME/bin/:$PATH

    make sure to source bashrc after you have added the above lines

  2. I downloaded MACS2 and numpy into my desired working directory from below :

  3. Next install the two downloaded packages, starting with numpy by going into their respective folders $ python install --prefix=$HOME

Hope this helps!

ADD COMMENTlink written 22 months ago by g.sathish.k0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1000 users visited in the last hour