MaciekAber / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

import pysam does not work #30

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I have installed successful Pyrex-0.9.9, but I was no able to install
Pysam-0.2 on Centos 5.2 64Bit in the following way:

um@ter: ~/temp/pysam-0.2 $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/pysam
copying pysam/__init__.py -> build/lib.linux-x86_64-2.6/pysam
copying pysam/Pileup.py -> build/lib.linux-x86_64-2.6/pysam
copying pysam/namedtuple.py -> build/lib.linux-x86_64-2.6/pysam
running build_ext
pyrexc pysam/csamtools.pyx --> pysam/csamtools.c
/home/um/temp/pysam-0.2/pysam/csamtools.pyx:255:15: Warning: 'not None'
will become the default in a future version of Pyrex. Use 'or None' to
allow passing None.
building 'pysam/csamtools' extension
creating build/temp.linux-x86_64-2.6
creating build/temp.linux-x86_64-2.6/pysam
creating build/temp.linux-x86_64-2.6/samtools
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c pysam/csamtools.c -o
build/temp.linux-x86_64-2.6/pysam/csamtools.o
In file included from pysam/csamtools.c:37:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
pysam/csamtools.c: In function ‘__pyx_f_5pysam_9csamtools_7Samfile_fetch’:
pysam/csamtools.c:2442: warning: passing argument 7 of ‘bam_fetch’ from
incompatible pointer type
pysam/csamtools.c: In function ‘__pyx_f_5pysam_9csamtools_7Samfile_pileup’:
pysam/csamtools.c:2772: warning: passing argument 7 of ‘bam_fetch’ from
incompatible pointer type
pysam/csamtools.c: In function
‘__pyx_f_5pysam_9csamtools_11IteratorRow___dealloc__’:
pysam/csamtools.c:4710: warning: implicit declaration of function
‘bam_cleanup_fetch_iterator’
pysam/csamtools.c: In function
‘__pyx_f_5pysam_9csamtools_11AlignedRead_5cigar___set__’:
pysam/csamtools.c:5506: warning: passing argument 4 of ‘pysam_bam_update’
from incompatible pointer type
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c pysam/pysam_util.c -o
build/temp.linux-x86_64-2.6/pysam/pysam_util.o
In file included from pysam/pysam_util.c:3:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
In file included from pysam/pysam_util.c:6:
samtools/bam_endian.h:7: warning: function declaration isn’t a prototype
pysam/pysam_util.c:34: warning: function declaration isn’t a prototype
pysam/pysam_util.c:66: warning: function declaration isn’t a prototype
pysam/pysam_util.c:66: warning: ‘mp_init’ defined but not used
pysam/pysam_util.c:72: warning: ‘mp_destroy’ defined but not used
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/faidx.c -o
build/temp.linux-x86_64-2.6/samtools/faidx.o
samtools/faidx.c:12: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/sam.c -o
build/temp.linux-x86_64-2.6/samtools/sam.o
In file included from samtools/sam.h:4,
                 from samtools/sam.c:4:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bgzf.c -o
build/temp.linux-x86_64-2.6/samtools/bgzf.o
samtools/bgzf.c:44: warning: function declaration isn’t a prototype
samtools/bgzf.c:115: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_aux.c -o
build/temp.linux-x86_64-2.6/samtools/bam_aux.o
In file included from samtools/bam_aux.c:2:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_aux.c:5: warning: function declaration isn’t a prototype
samtools/bam_aux.c:6: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_tview.c -o
build/temp.linux-x86_64-2.6/samtools/bam_tview.o
samtools/bam_tview.c:409:2: warning: #warning "No curses library is
available; tview is disabled."
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_stat.c -o
build/temp.linux-x86_64-2.6/samtools/bam_stat.o
In file included from samtools/bam_stat.c:3:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_maqcns.c -o
build/temp.linux-x86_64-2.6/samtools/bam_maqcns.o
In file included from samtools/bam_maqcns.c:3:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
In file included from samtools/bam_maqcns.h:4,
                 from samtools/bam_maqcns.c:4:
samtools/glf.h:43: warning: function declaration isn’t a prototype
In file included from samtools/bam_maqcns.c:4:
samtools/bam_maqcns.h:39: warning: function declaration isn’t a prototype
samtools/bam_maqcns.h:47: warning: function declaration isn’t a prototype
samtools/bam_maqcns.c:105: warning: function declaration isn’t a prototype
samtools/bam_maqcns.c:309: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_lpileup.c -o
build/temp.linux-x86_64-2.6/samtools/bam_lpileup.o
In file included from samtools/bam_lpileup.c:4:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_lpileup.c:24: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/kaln.c -o
build/temp.linux-x86_64-2.6/samtools/kaln.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/sam_header.c -o
build/temp.linux-x86_64-2.6/samtools/sam_header.o
samtools/sam_header.c:9: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam.c -o
build/temp.linux-x86_64-2.6/samtools/bam.o
In file included from samtools/bam.c:5:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
In file included from samtools/bam.c:6:
samtools/bam_endian.h:7: warning: function declaration isn’t a prototype
samtools/bam.c:46: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/razf.c -o
build/temp.linux-x86_64-2.6/samtools/razf.o
samtools/razf.c:74: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_md.c -o
build/temp.linux-x86_64-2.6/samtools/bam_md.o
In file included from samtools/sam.h:4,
                 from samtools/bam_md.c:6:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_plcmd.c -o
build/temp.linux-x86_64-2.6/samtools/bam_plcmd.o
In file included from samtools/sam.h:4,
                 from samtools/bam_plcmd.c:5:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
In file included from samtools/bam_maqcns.h:4,
                 from samtools/bam_plcmd.c:7:
samtools/glf.h:43: warning: function declaration isn’t a prototype
In file included from samtools/bam_plcmd.c:7:
samtools/bam_maqcns.h:39: warning: function declaration isn’t a prototype
samtools/bam_maqcns.h:47: warning: function declaration isn’t a prototype
samtools/bam_plcmd.c:13: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_sort.c -o
build/temp.linux-x86_64-2.6/samtools/bam_sort.o
In file included from samtools/bam_sort.c:7:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_pileup.c -o
build/temp.linux-x86_64-2.6/samtools/bam_pileup.o
In file included from samtools/sam.h:4,
                 from samtools/bam_pileup.c:5:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_pileup.c:21: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/knetfile.c -o
build/temp.linux-x86_64-2.6/samtools/knetfile.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_rmdup.c -o
build/temp.linux-x86_64-2.6/samtools/bam_rmdup.o
In file included from samtools/sam.h:4,
                 from samtools/bam_rmdup.c:6:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_rmdup.c:11: warning: function declaration isn’t a prototype
samtools/bam_rmdup.c:12: warning: function declaration isn’t a prototype
samtools/bam_rmdup.c:20: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_color.c -o
build/temp.linux-x86_64-2.6/samtools/bam_color.o
In file included from samtools/bam_color.c:2:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/kstring.c -o
build/temp.linux-x86_64-2.6/samtools/kstring.o
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_import.c -o
build/temp.linux-x86_64-2.6/samtools/bam_import.o
In file included from samtools/bam_import.c:12:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_import.c:18: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_mate.c -o
build/temp.linux-x86_64-2.6/samtools/bam_mate.o
In file included from samtools/bam_mate.c:3:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/glf.c -o
build/temp.linux-x86_64-2.6/samtools/glf.o
In file included from samtools/glf.c:3:
samtools/glf.h:43: warning: function declaration isn’t a prototype
samtools/glf.c:23: warning: function declaration isn’t a prototype
samtools/glf.c:29: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_rmdupse.c -o
build/temp.linux-x86_64-2.6/samtools/bam_rmdupse.o
In file included from samtools/sam.h:4,
                 from samtools/bam_rmdupse.c:2:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
samtools/bam_rmdupse.c:15: warning: function declaration isn’t a prototype
samtools/bam_rmdupse.c:15: warning: function declaration isn’t a prototype
samtools/bam_rmdupse.c:18: warning: function declaration isn’t a prototype
samtools/bam_rmdupse.c:25: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/sam_view.c -o
build/temp.linux-x86_64-2.6/samtools/sam_view.o
In file included from samtools/sam.h:4,
                 from samtools/sam_view.c:7:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall
-Wstrict-prototypes -fPIC -Isamtools
-I/home/um/programs/python/include/python2.6 -c samtools/bam_index.c -o
build/temp.linux-x86_64-2.6/samtools/bam_index.o
In file included from samtools/bam_index.c:3:
samtools/bam.h:342: warning: function declaration isn’t a prototype
samtools/bam.h:352: warning: function declaration isn’t a prototype
In file included from samtools/bam_index.c:6:
samtools/bam_endian.h:7: warning: function declaration isn’t a prototype
samtools/bam_index.c:62: warning: function declaration isn’t a prototype
gcc -pthread -shared build/temp.linux-x86_64-2.6/pysam/csamtools.o
build/temp.linux-x86_64-2.6/pysam/pysam_util.o
build/temp.linux-x86_64-2.6/samtools/faidx.o
build/temp.linux-x86_64-2.6/samtools/sam.o
build/temp.linux-x86_64-2.6/samtools/bgzf.o
build/temp.linux-x86_64-2.6/samtools/bam_aux.o
build/temp.linux-x86_64-2.6/samtools/bam_tview.o
build/temp.linux-x86_64-2.6/samtools/bam_stat.o
build/temp.linux-x86_64-2.6/samtools/bam_maqcns.o
build/temp.linux-x86_64-2.6/samtools/bam_lpileup.o
build/temp.linux-x86_64-2.6/samtools/kaln.o
build/temp.linux-x86_64-2.6/samtools/sam_header.o
build/temp.linux-x86_64-2.6/samtools/bam.o
build/temp.linux-x86_64-2.6/samtools/razf.o
build/temp.linux-x86_64-2.6/samtools/bam_md.o
build/temp.linux-x86_64-2.6/samtools/bam_plcmd.o
build/temp.linux-x86_64-2.6/samtools/bam_sort.o
build/temp.linux-x86_64-2.6/samtools/bam_pileup.o
build/temp.linux-x86_64-2.6/samtools/knetfile.o
build/temp.linux-x86_64-2.6/samtools/bam_rmdup.o
build/temp.linux-x86_64-2.6/samtools/bam_color.o
build/temp.linux-x86_64-2.6/samtools/kstring.o
build/temp.linux-x86_64-2.6/samtools/bam_import.o
build/temp.linux-x86_64-2.6/samtools/bam_mate.o
build/temp.linux-x86_64-2.6/samtools/glf.o
build/temp.linux-x86_64-2.6/samtools/bam_rmdupse.o
build/temp.linux-x86_64-2.6/samtools/sam_view.o
build/temp.linux-x86_64-2.6/samtools/bam_index.o -lz -o
build/lib.linux-x86_64-2.6/pysam/csamtools.so
running install_lib
creating /home/um/programs/python/lib/python2.6/site-packages/pysam
copying build/lib.linux-x86_64-2.6/pysam/__init__.py ->
/home/um/programs/python/lib/python2.6/site-packages/pysam
copying build/lib.linux-x86_64-2.6/pysam/Pileup.py ->
/home/um/programs/python/lib/python2.6/site-packages/pysam
copying build/lib.linux-x86_64-2.6/pysam/namedtuple.py ->
/home/um/programs/python/lib/python2.6/site-packages/pysam
copying build/lib.linux-x86_64-2.6/pysam/csamtools.so ->
/home/um/programs/python/lib/python2.6/site-packages/pysam
byte-compiling
/home/um/programs/python/lib/python2.6/site-packages/pysam/__init__.py to
__init__.pyc
byte-compiling
/home/um/programs/python/lib/python2.6/site-packages/pysam/Pileup.py to
Pileup.pyc
byte-compiling
/home/um/programs/python/lib/python2.6/site-packages/pysam/namedtuple.py to
namedtuple.pyc
running install_egg_info
Writing
/home/um/programs/python/lib/python2.6/site-packages/pysam-0.2-py2.6.egg-info

After the installation I have tried Pysam in the following way

$python
Python 2.6.4 (r264:75706, Jan 28 2010, 14:19:59) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pysam
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pysam/__init__.py", line 1, in <module>
    from csamtools import *
ImportError: No module named csamtools
>>>

Original issue reported on code.google.com by mit...@op.pl on 6 May 2010 at 12:41

GoogleCodeExporter commented 8 years ago
Most likely "/home/um/programs/python/lib/python2.6/site-packages/" is not in
Python's module search path.
To check, either type "echo $PYTHONPATH" at the shell prompt or type
import sys
sys.path
at the Python prompt. Perhaps the document at http://docs.python.org/install/ 
helps
you figure out how to install the module correctly.

Original comment by marcel.m...@tu-dortmund.de on 11 May 2010 at 9:57

GoogleCodeExporter commented 8 years ago
I used the above steps and have got following output:
$echo $PYTHONPATH                                      

$python
Python 2.6.4 (r264:75706, Jan 28 2010, 14:19:59) 
[GCC 4.1.2 20071124 (Red Hat 4.1.2-42)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['',
'/home/um/programs/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.eg
g',
'/home/um/programs/python/lib/python2.6/site-packages/lxml-2.2.6-py2.6-linux-x86
_64.egg',
'/home/um/programs/python/lib/python26.zip',
'/home/um/programs/python/lib/python2.6',
'/home/um/programs/python/lib/python2.6/plat-linux2',
'/home/um/programs/python/lib/python2.6/lib-tk',
'/home/um/programs/python/lib/python2.6/lib-old',
'/home/um/programs/python/lib/python2.6/lib-dynload',
'/home/um/programs/python/lib/python2.6/site-packages']
>>> 

Is this correct?

Original comment by mit...@op.pl on 12 May 2010 at 11:16

GoogleCodeExporter commented 8 years ago
This looks correct. I now realize what happened: You have probably tried to 
execute
"import pysam" while you were still in  the installation directory (which 
contains a
subdirectory named "pysam").

Just go to some other directory, start Python there and try "import pysam" 
again.

Original comment by marcel.m...@tu-dortmund.de on 17 May 2010 at 7:52

GoogleCodeExporter commented 8 years ago
Thank you it works.

Original comment by mit...@op.pl on 18 May 2010 at 10:25

GoogleCodeExporter commented 8 years ago
Thanks for providing support!

Original comment by andreas....@gmail.com on 18 Jul 2010 at 6:03

GoogleCodeExporter commented 8 years ago

Original comment by andreas....@gmail.com on 18 Jul 2010 at 6:04

GoogleCodeExporter commented 8 years ago
3# you are so smart!!!

Original comment by farmingt...@gmail.com on 12 Dec 2014 at 8:42

GoogleCodeExporter commented 8 years ago
Thank you

Original comment by mads....@gmail.com on 28 Jan 2015 at 7:51