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

Hi, I'm trying to install macs2. After set the path and python path, I've tried to run macs2 and I have the following error message

Traceback (most recent call last):
  File "/home/projas/MACS2-2.1.1.20160309/bin/macs2", line 31, in <module>
    from MACS2.Constants import *
ImportError: No module named 'MACS2'

does anyone know whats going on?

Thanks!

chip-seq

I'm not familiar with the software, but it looks like a standard python error where it can't find your modules. Which installation approach did you use?

I've used that:

$ pip install -U --no-deps MACS2

And after that I set my PYTHONPATH and PATH as follow:

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

Hmm, what's the output if you run pip show MACS2? And also, what is the output of python -c "import sys; print sys.path"? We want to see if the path to the MACS2 directory is in your python path. It seems like your python is currently not looking for the module in the right place.

for pip show MACS2

Location: /home/projas/MACS2-2.1.1.20160309

and for python -c import sys; print sys.path

 File "<string>", line 1
    import
         ^
SyntaxError: invalid syntax
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/%{ <-- HERE (.*?)}/ at /usr/bin/print line 528.
Error: no such file "sys.path"

is the error here?

Thank you

No sorry, did you remember the quotation marks on the last one? python -c "import sys; print sys.path"

Sorry,

['', '/usr/local/lib/python2.7/site-packages', '/home/projas/MACS2-2.1.1.20160309', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

Ok, what's the output of this command: python -c "from MACS2.Constants import *; print MACS_VERSION"?

It says:

No module named MACS2.Constants

any clues?

Yes, the python you're using to run MACS can't see the MACS directory. Try this: export PYTHONPATH=/home/projas/MACS2-2.1.1.20160309/:$PYTHONPATH. To check if it works, then try python -c "from MACS2.Constants import *; print MACS_VERSION" again. What is the output now?

Hello. I encountered the same issue, and still could not get the correct answer after following steps given above. Please help. It is still saying No module named MACS2.Constants

Lila M : Please use ADD REPLY/ADD COMMENT when responding to existing posts to keep threads logically organized.

Is it possible to use the Anaconda package manager to install?

Simply download Anaconda, and then do conda install -c bioconda macs2

Thanks, it totally works now!

0 answers

No answers yet.

Log in to answer this question.