Installation not working ModuleNotFoundError: No module named 'pysamstats.opt'

45 views
Skip to first unread message

senay Idris

unread,
Feb 28, 2022, 2:07:29 AM2/28/22
to Pysam User group
Hi

I have tried installing with git clone and pip and i just cant get install functional.
When i try 

nosetests -v  # optional, run test suite

I get the following error

Failure: ModuleNotFoundError (No module named 'pysamstats.opt') ... ERROR


======================================================================

ERROR: Failure: ModuleNotFoundError (No module named 'pysamstats.opt')

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/home/uqsidris/.local/lib/python3.8/site-packages/nose/failure.py", line 39, in runTest

    raise self.exc_val.with_traceback(self.tb)

  File "/home/uqsidris/.local/lib/python3.8/site-packages/nose/loader.py", line 417, in loadTestsFromName

    module = self.importer.importFromPath(

  File "/home/uqsidris/.local/lib/python3.8/site-packages/nose/importer.py", line 47, in importFromPath

    return self.importFromDir(dir_path, fqname)

  File "/home/uqsidris/.local/lib/python3.8/site-packages/nose/importer.py", line 94, in importFromDir

    mod = load_module(part_fqname, fh, filename, desc)

  File "/usr/lib/python3.8/imp.py", line 244, in load_module

    return load_package(name, filename)

  File "/usr/lib/python3.8/imp.py", line 216, in load_package

    return _load(spec)

  File "<frozen importlib._bootstrap>", line 702, in _load

  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked

  File "<frozen importlib._bootstrap_external>", line 848, in exec_module

  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed

  File "/home/uqsidris/pysamstats/pysamstats/__init__.py", line 8, in <module>

    from .pileup import *

  File "/home/uqsidris/pysamstats/pysamstats/pileup.py", line 6, in <module>

    import pysamstats.opt as opt

ModuleNotFoundError: No module named 'pysamstats.opt'


----------------------------------------------------------------------

Ran 1 test in 0.001s


FAILED (errors=1)

senay Idris

unread,
Feb 28, 2022, 2:08:08 AM2/28/22
to Pysam User group
Please let me know what i can do here..Im a bit out of ideas..

senay Idris

unread,
Feb 28, 2022, 2:09:11 AM2/28/22
to Pysam User group
when i was installing i had the following



sudo python setup.py install

[pysamstats] build with Cython

Compiling pysamstats/opt.pyx because it depends on /usr/local/lib/python3.8/dist-packages/pysam/libcalignmentfile.pxd.

[1/1] Cythonizing pysamstats/opt.pyx

/usr/local/lib/python3.8/dist-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/uqsidris/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 dependency_links to pysamstats.egg-info/dependency_links.txt

writing requirements to pysamstats.egg-info/requires.txt

writing top-level names to pysamstats.egg-info/top_level.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

x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/local/lib/python3.8/dist-packages/pysam -I/usr/local/lib/python3.8/dist-packages/pysam/include/htslib -I/usr/local/lib/python3.8/dist-packages/pysam/include/samtools -I/usr/include/python3.8 -c pysamstats/opt.c -o build/temp.linux-x86_64-3.8/pysamstats/opt.o

In file included from /usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/vcf.h:42,

                 from /usr/local/lib/python3.8/dist-packages/pysam/htslib_util.h:5,

                 from pysamstats/opt.c:658:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hts_endian.h: In function ‘le_to_i32’:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hts_endian.h:245:34: warning: operand of ?: changes signedness from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare]

  245 |     return v < 0x80000000U ? v : -((int32_t) (0xffffffffU - v)) - 1;

      |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hts_endian.h: In function ‘le_to_i64’:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hts_endian.h:257:19: warning: operand of ?: changes signedness from ‘long int’ to ‘uint64_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare]

  257 |             ? v : -((int64_t) (0xffffffffffffffffULL - v)) - 1);

      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In file included from pysamstats/opt.c:659:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hfile.h: In function ‘hwrite’:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/hfile.h:245:35: warning: comparison of integer expressions of different signedness: ‘long int’ and ‘size_t’ {aka long unsigned int’} [-Wsign-compare]

  245 |         if (fp->limit - fp->begin < nbytes){

      |                                   ^

pysamstats/opt.c: In function ‘__pyx_f_10pysamstats_3opt_15AlignmentBinned_recv’:

pysamstats/opt.c:32068:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]

32068 |     for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {

      |                                   ^

pysamstats/opt.c: In function ‘__pyx_f_10pysamstats_3opt_is_softclipped’:

pysamstats/opt.c:39076:33: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]

39076 |   for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {

      |                                 ^

In file included from /usr/local/lib/python3.8/dist-packages/pysam/pysam_stream.h:4,

                 from pysamstats/opt.c:668:

At top level:

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:198:12: warning: kseq_read’ defined but not used [-Wunused-function]

  198 |  SCOPE int kseq_read(kseq_t *seq) \

      |            ^~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:250:2: note: in expansion of macro ‘__KSEQ_READ

  250 |  __KSEQ_READ(SCOPE)

      |  ^~~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2

  252 | #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)

      |                                   ^~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT

    9 | KSEQ_INIT(BGZF *, bgzf_read)

      | ^~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:184:13: warning: kseq_destroy’ defined but not used [-Wunused-function]

  184 |  SCOPE void kseq_destroy(kseq_t *ks)         \

      |             ^~~~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:249:2: note: in expansion of macro ‘__KSEQ_BASIC

  249 |  __KSEQ_BASIC(SCOPE, type_t)     \

      |  ^~~~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2

  252 | #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)

      |                                   ^~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT

    9 | KSEQ_INIT(BGZF *, bgzf_read)

      | ^~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:178:16: warning: kseq_init’ defined but not used [-Wunused-function]

  178 |  SCOPE kseq_t *kseq_init(type_t fd)         \

      |                ^~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:249:2: note: in expansion of macro ‘__KSEQ_BASIC

  249 |  __KSEQ_BASIC(SCOPE, type_t)     \

      |  ^~~~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/include/htslib/htslib/kseq.h:252:35: note: in expansion of macro ‘KSEQ_INIT2

  252 | #define KSEQ_INIT(type_t, __read) KSEQ_INIT2(static, type_t, __read)

      |                                   ^~~~~~~~~~

/usr/local/lib/python3.8/dist-packages/pysam/pysam_stream.h:9:1: note: in expansion of macro ‘KSEQ_INIT

    9 | KSEQ_INIT(BGZF *, bgzf_read)

      | ^~~~~~~~~

x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.8/pysamstats/opt.o -o build/lib.linux-x86_64-3.8/pysamstats/opt.cpython-38-x86_64-linux-gnu.so

creating build/bdist.linux-x86_64/egg

creating build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/config.py -> build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/__init__.py -> build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/binned.py -> build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/opt.cpython-38-x86_64-linux-gnu.so -> build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/io.py -> build/bdist.linux-x86_64/egg/pysamstats

copying build/lib.linux-x86_64-3.8/pysamstats/util.py -> build/bdist.linux-x86_64/egg/pysamstats

creating build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/__init__.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/test_pileup.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/test_io.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/test_binned.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/util.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/test/test_regression.py -> build/bdist.linux-x86_64/egg/pysamstats/test

copying build/lib.linux-x86_64-3.8/pysamstats/pileup.py -> build/bdist.linux-x86_64/egg/pysamstats

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/config.py to config.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/__init__.py to __init__.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/binned.py to binned.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/io.py to io.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/util.py to util.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/__init__.py to __init__.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/test_pileup.py to test_pileup.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/test_io.py to test_io.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/test_binned.py to test_binned.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/util.py to util.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/test/test_regression.py to test_regression.cpython-38.pyc

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/pileup.py to pileup.cpython-38.pyc

creating stub loader for pysamstats/opt.cpython-38-x86_64-linux-gnu.so

byte-compiling build/bdist.linux-x86_64/egg/pysamstats/opt.py to opt.cpython-38.pyc

creating build/bdist.linux-x86_64/egg/EGG-INFO

installing scripts to build/bdist.linux-x86_64/egg/EGG-INFO/scripts

running install_scripts

running build_scripts

creating build/bdist.linux-x86_64/egg/EGG-INFO/scripts

copying build/scripts-3.8/pysamstats -> build/bdist.linux-x86_64/egg/EGG-INFO/scripts

changing mode of build/bdist.linux-x86_64/egg/EGG-INFO/scripts/pysamstats to 755

copying pysamstats.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO

copying pysamstats.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying pysamstats.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying pysamstats.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying pysamstats.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt

zip_safe flag not set; analyzing archive contents...

pysamstats.__pycache__.opt.cpython-38: module references __file__

creating 'dist/pysamstats-1.1.2-py3.8-linux-x86_64.egg' and adding 'build/bdist.linux-x86_64/egg' to it

removing 'build/bdist.linux-x86_64/egg' (and everything under it)

Processing pysamstats-1.1.2-py3.8-linux-x86_64.egg

removing '/usr/local/lib/python3.8/dist-packages/pysamstats-1.1.2-py3.8-linux-x86_64.egg' (and everything under it)

creating /usr/local/lib/python3.8/dist-packages/pysamstats-1.1.2-py3.8-linux-x86_64.egg

Extracting pysamstats-1.1.2-py3.8-linux-x86_64.egg to /usr/local/lib/python3.8/dist-packages

pysamstats 1.1.2 is already the active version in easy-install.pth

Installing pysamstats script to /usr/local/bin


Installed /usr/local/lib/python3.8/dist-packages/pysamstats-1.1.2-py3.8-linux-x86_64.egg

Processing dependencies for pysamstats==1.1.2

Searching for pysam==0.15.4

Best match: pysam 0.15.4

Processing pysam-0.15.4-py3.8-linux-x86_64.egg

pysam 0.15.4 is already the active version in easy-install.pth


Using /usr/local/lib/python3.8/dist-packages/pysam-0.15.4-py3.8-linux-x86_64.egg

Searching for numpy==1.20.3

Best match: numpy 1.20.3

Adding numpy 1.20.3 to easy-install.pth file

Installing f2py script to /usr/local/bin

Installing f2py3 script to /usr/local/bin

Installing f2py3.8 script to /usr/local/bin


Using /usr/local/lib/python3.8/dist-packages

Finished processing dependencies for pysamstats==1.1.2


On Monday, 28 February 2022 at 5:07:29 pm UTC+10 senay Idris wrote:

senay Idris

unread,
Feb 28, 2022, 6:20:51 AM2/28/22
to Pysam User group
To note. i think i got something working but i get the following error 

pysamstats --fasta ~/workdir/cDNA007/mrna_gfp_ref.fasta --type variation ~/workdir/cDNA007/allBC1_modified_sorted.bam > ~/workdir/cDNA007/allBC1_modified_sorted_pysam.bed

Traceback (most recent call last):

  File "/home/uqsidris/.local/bin/pysamstats", line 10, in <module>

    import pysamstats

  File "/home/uqsidris/.local/lib/python3.8/site-packages/pysamstats/__init__.py", line 8, in <module>

    from .pileup import *

  File "/home/uqsidris/.local/lib/python3.8/site-packages/pysamstats/pileup.py", line 6, in <module>

    import pysamstats.opt as opt

  File "pysamstats/opt.pyx", line 1, in init pysamstats.opt

AttributeError: module 'pysam.libcalignmentfile' has no attribute 'IteratorColumnAll'


Reply all
Reply to author
Forward
0 new messages