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

ImportError when use macs2 #3

Closed
hanfeisun opened this issue Jul 18, 2011 · 5 comments
Closed

ImportError when use macs2 #3

hanfeisun opened this issue Jul 18, 2011 · 5 comments

Comments

@hanfeisun
Copy link

I use python setup.py install on a Ubuntu server.
However, when I run "macs2" in terminal.
It shows like this:

Traceback (most recent call last):
File "/usr/local/bin/macs2", line 35, in
from MACS2.OptValidator import opt_validate
File "/usr/local/lib/python2.6/dist-packages/MACS2/OptValidator.py", line 26, in
from MACS2.IO.cParser import BEDParser, ELANDResultParser, ELANDMultiParser, ELANDExportParser, SAMParser, BAMParser, BowtieParser, guess_parser
ImportError: /usr/local/lib/python2.6/dist-packages/MACS2/IO/cParser.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

I've installed numpy and cython in this server, but when I get into the directory of /usr/local/lib/python2.6/dist-packages/MACS2/IO. I found cFeatIO.so was not there. I get a copy from other server and put it here. But It didn't work.

@taoliu
Copy link
Contributor

taoliu commented Jul 18, 2011

Can you try to remove the old installation and the whole 'build' subdirectory in the source code directory, also all the .c files:

$ find MACS2/ -name '*.c' -delete

@hanfeisun
Copy link
Author

I've deleted all the .c file ,the 'build' subdirectory and the old installationand,then run the setup.py again.

root@BioServer3:/mnt/Storage/home/sunhf/software_packages/taoliu-MACS-5085ee9# python setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.6
creating build/lib.linux-x86_64-2.6/MACS2
copying MACS2/Constants.py -> build/lib.linux-x86_64-2.6/MACS2
copying MACS2/OptValidator.py -> build/lib.linux-x86_64-2.6/MACS2
copying MACS2/OutputWriter.py -> build/lib.linux-x86_64-2.6/MACS2
copying MACS2/PeakModel.py -> build/lib.linux-x86_64-2.6/MACS2
copying MACS2/init.py -> build/lib.linux-x86_64-2.6/MACS2
creating build/lib.linux-x86_64-2.6/MACS2/IO
copying MACS2/IO/BinKeeper.py -> build/lib.linux-x86_64-2.6/MACS2/IO
copying MACS2/IO/WiggleIO.py -> build/lib.linux-x86_64-2.6/MACS2/IO
copying MACS2/IO/init.py -> build/lib.linux-x86_64-2.6/MACS2/IO
copying MACS2/IO/bedGraphIO.py -> build/lib.linux-x86_64-2.6/MACS2/IO
running build_ext
cythoning MACS2/cProb.pyx to MACS2/cProb.c

Error converting Pyrex file to C:

...
from cpython cimport bool

^

/mnt/Storage/home/sunhf/software_packages/taoliu-MACS-5085ee9/MACS2/cProb.pxd:1:0: 'cpython.pxd' not found

Error converting Pyrex file to C:

building 'MACS2.cProb' extension
creating build/temp.linux-x86_64-2.6
creating build/temp.linux-x86_64-2.6/MACS2
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.6 -c MACS2/cProb.c -o build/temp.linux-x86_64-2.6/MACS2/cProb.o
MACS2/cProb.c:1: error: #error Do not use this file, it is the result of a failed Cython compilation.
error: command 'gcc' failed with exit status 1

@taoliu
Copy link
Contributor

taoliu commented Jul 18, 2011

Cython (>=0.14.1) is required to run MACS v2. Can you check the version in your system?

@hanfeisun
Copy link
Author

I see~ I install cython by apt-get, which is not the newest version.
I install a newer version and it's OK now.

@lanzinuo
Copy link

I also have a problem similarly.< ImportError: No module named MACS2.Constants . > how can I solve it ?

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

3 participants