pysamstats icon indicating copy to clipboard operation
pysamstats copied to clipboard

ImportError: No module named opt

Open lybird300 opened this issue 7 years ago • 3 comments

Hi there,

My python verion is 2.7.11. I installed pysamstats from github master directly after installing pysam-0.15.1.

I got the following error. What do you think might be the problem and how should I fix it? Thank you for your time.

import pysam import pysamstats Traceback (most recent call last): File "", line 1, in File "pysamstats/init.py", line 8, in from .pileup import * File "pysamstats/pileup.py", line 6, in import pysamstats.opt as opt ImportError: No module named 'pysamstats.opt'

Best, Yuan

lybird300 avatar Nov 13 '18 08:11 lybird300

Hi there, the error suggests that the Cython module did not compile or get installed for some reason. Could you say how you tried to install pysamstats?

On Tue, 13 Nov 2018, 08:35 lybird300 <[email protected] wrote:

Hi there,

My python verion is 2.7.11. I installed pysamstats from github master directly after installing pysam-0.15.1.

I got the following error. What do you think might be the problem and how should I fix it? Thank you for your time.

import pysam import pysamstats

Traceback (most recent call last): File "", line 1, in File "pysamstats/init.py", line 8, in from .pileup import * File "pysamstats/pileup.py", line 6, in import pysamstats.opt as opt

Best, Yuan

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/alimanfoo/pysamstats/issues/95, or mute the thread https://github.com/notifications/unsubscribe-auth/AAq8Qt0fIXe3620-dvm-VkPrq8-_3cL1ks5uuoQ3gaJpZM4YbJpG .

alimanfoo avatar Nov 13 '18 09:11 alimanfoo

Hi Alistair, thank you for your prompt reply. I followed the third installation option, i.e.,

$ git clone git://github.com/alimanfoo/pysamstats.git $ cd pysamstats $ python setup.py install

Not sure if that matters, but I did the above in a python virtual environment

Thanks! Yuan

lybird300 avatar Nov 13 '18 12:11 lybird300

I did get some warnings though (attached below)

[1/1] Cythonizing pysamstats/opt.pyx /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /lustre1/gaog_pkuhpc/build/pysamstats/pysamstats/opt.pyx tree = Parsing.p_module(s, pxd, full_module_name) running install running bdist_egg running egg_info writing pysamstats.egg-info/PKG-INFO writing top-level names to pysamstats.egg-info/top_level.txt writing dependency_links to pysamstats.egg-info/dependency_links.txt reading manifest file 'pysamstats.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' warning: no files found matching '*.pxd' under directory 'pysamstats' writing manifest file 'pysamstats.egg-info/SOURCES.txt' installing library code to build/bdist.linux-x86_64/egg running install_lib running build_py running build_ext building 'pysamstats.opt' extension gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam -I/lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib -I/lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/samtools -I/apps/bioinfo/python2.7.11/include/python2.7 -c pysamstats/opt.c -o build/temp.linux-x86_64-2.7/pysamstats/opt.o In file included from /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/hts.h:35:0, from /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/sam.h:31, from /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/htslib_util.h:4, from pysamstats/opt.c:648: /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/hts_log.h:52:6: warning: function declaration isn’t a prototype [-Wstrict-prototypes] enum htsLogLevel hts_get_log_level(); ^ In file included from /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/pysam_stream.h:4:0, from pysamstats/opt.c:658: /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:178:16: warning: ‘kseq_init’ defined but not used [-Wunused-function] SCOPE kseq_t *kseq_init(type_t fd)
^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:249:2: note: in expansion of macro ‘__KSEQ_BASIC’ __KSEQ_BASIC(SCOPE, type_t)
^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2’ #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT’ KSEQ_INIT(BGZF *, bgzf_read) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:184:13: warning: ‘kseq_destroy’ defined but not used [-Wunused-function] SCOPE void kseq_destroy(kseq_t *ks)
^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:249:2: note: in expansion of macro ‘__KSEQ_BASIC’ __KSEQ_BASIC(SCOPE, type_t)
^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2’ #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT’ KSEQ_INIT(BGZF *, bgzf_read) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:198:12: warning: ‘kseq_read’ defined but not used [-Wunused-function] SCOPE int kseq_read(kseq_t *seq)
^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:250:2: note: in expansion of macro ‘__KSEQ_READ’ __KSEQ_READ(SCOPE) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2’ #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read) ^ /lustre1/gaog_pkuhpc/users/liny/rnaseq/pythonEnv/lib/python2.7/site-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT’ KSEQ_INIT(BGZF *, bgzf_read) ^ gcc -pthread -shared build/temp.linux-x86_64-2.7/pysamstats/opt.o -o build/lib.linux-x86_64-2.7/pysamstats/opt.so

lybird300 avatar Nov 13 '18 12:11 lybird300