Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • DavyK
    Junior Member
    • Jun 2012
    • 9

    Import error after installing Pysam

    Hi all,
    I now there are a couple of threads asking about installing pysam already, and I tried the solutions posted there to no avail.

    I am trying in install pysam on my MAC running OSX 10.7 with python 2.7.3.

    I have downloaded and appear to have successfully installed samtools and added it to my path. When I type samtools into the command line I get the nice help message that one expects to see if you don't give anything to do.

    So after downloading, unpacking and entering into the directory of the latest version of pysam, when I run 'python setup.py build' there are many warnings, but the script doesn't exit, so I tried installing it after build anyway. The install seems to go fine, but when I start up IDLE and try to import pysam I get the following error:

    Code:
    Traceback (most recent call last):
    
    File "<pyshell#0>", line 1, in <module>
    import pysam
    File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysam-0.6-py2.7-macosx-10.6-intel.egg/pysam/init.py", line 1, in <module>
    from csamtools import
    ImportError?: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysam-0.6-py2.7-macosx-10.6-intel.egg/csamtools.so, 2): Symbol not found: ks_insertsort_heap
    Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysam-0.6-py2.7-macosx-10.6-intel.egg/csamtools.so Expected in: flat namespace
    in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pysam-0.6-py2.7-macosx-10.6-intel.egg/csamtools.so

    the output of the setup.py build command is too large to post here but some of the out if helps is:

    Code:
    running build running build_py creating build creating build/lib.macosx-10.6-intel-2.7 creating build/lib.macosx-10.6-intel-2.7/pysam copying pysam/init.py -> build/lib.macosx-10.6-intel-2.7/pysam copying pysam/Pileup.py -> build/lib.macosx-10.6-intel-2.7/pysam copying pysam/namedtuple.py -> build/lib.macosx-10.6-intel-2.7/pysam copying pysam/version.py -> build/lib.macosx-10.6-intel-2.7/pysam running build_ext gcc-4.2 not found, using clang instead building 'csamtools' extension creating build/temp.macosx-10.6-intel-2.7 creating build/temp.macosx-10.6-intel-2.7/pysam creating build/temp.macosx-10.6-intel-2.7/samtools creating build/temp.macosx-10.6-intel-2.7/samtools/bcftools creating build/temp.macosx-10.6-intel-2.7/samtools/misc clang -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE= -Isamtools -Ipysam -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pysam/csamtools.c -o build/temp.macosx-10.6-intel-2.7/pysam/csamtools.o pysam/csamtools.c:8432:249: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rstart, pyx_v_rend, ((void )pyx_v_callback), pyx_f_9csamtools_fetch_callback)); if ...
    ^
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:8840:427: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...+ 1), ((void )(&pyx_v_mate_data)), pyx_f_9csamtools_mate_callback);
    ^~
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:9327:222: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rstart, pyx_v_rend, ((void )(&pyx_v_counter)), pyx_f_9csamtools_count_callback);
    ^
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:9764:207: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rtid, pyx_v_rstart, pyx_v_rend, pyx_v_buf, pyx_f_9csamtools_pileup_fetch_callback);
    ^~
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:15344:7: warning: implicit declaration of function 'bam_prob_realn' is invalid in C99
    [-Wimplicit-function-declaration] bam_prob_realn(pyx_v_b, pyx_v_d->seq); ^
    pysam/csamtools.c:15372:19: warning: implicit declaration of function 'bam_cap_mapQ' is invalid in C99
    [-Wimplicit-function-declaration] pyx_v_q = bam_cap_mapQ(pyx_v_b, pyx_v_d->seq, pyx_v_capQ_thres);
    ^
    6 warnings generated. pysam/csamtools.c:8432:249: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rstart, pyx_v_rend, ((void )pyx_v_callback), pyx_f_9csamtools_fetch_callback)); if ...
    ^
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:8840:427: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...+ 1), ((void )(&pyx_v_mate_data)), pyx_f_9csamtools_mate_callback);
    ^~
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:9327:222: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rstart, pyx_v_rend, ((void )(&pyx_v_counter)), pyx_f_9csamtools_count_callback);
    ^
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:9764:207: warning: incompatible pointer types passing 'int (bam1_t , void )' to parameter
    of type 'bam_fetch_f' (aka 'int ()(const bam1_t , void )') [-Wincompatible-pointer-types]
    ...pyx_v_rtid, pyx_v_rstart, pyx_v_rend, pyx_v_buf, pyx_f_9csamtools_pileup_fetch_callback);
    ^~
    samtools/bam.h:626:103: note: passing argument to parameter 'func' here
    ...bam_fetch(bamFile fp, const bam_index_t idx, int tid, int beg, int end, void data, bam_fetch_f func);
    ^
    pysam/csamtools.c:15344:7: warning: implicit declaration of function 'bam_prob_realn' is invalid in C99
    [-Wimplicit-function-declaration] bam_prob_realn(pyx_v_b, pyx_v_d->seq); ^
    pysam/csamtools.c:15372:19: warning: implicit declaration of function 'bam_cap_mapQ' is invalid in C99
    [-Wimplicit-function-declaration] pyx_v_q = bam_cap_mapQ(pyx_v_b, pyx_v_d->seq, pyx_v_capQ_thres);

    I noticed that it says gcc-4.2 is not found. but when I type gcc at the command prompt It says: i686-apple-darwin11-llvm-gcc-4.2: no input files So I think that means it's installed.

    Any help is appreciated, Cheers, Davy
  • Dogetorenk
    Banned
    • Aug 2012
    • 6

    #2
    i think maybe the version which you have installed of PYSAM is not supporting your mac os so i would prefer you to contact the moderator of the site and to look up for the version which is suitable for your mac os.
    Last edited by Dogetorenk; 11-15-2012, 08:29 PM.

    Comment

    Latest Articles

    Collapse

    • SEQadmin2
      Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
      by SEQadmin2


      Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

      The systematic characterization of the human proteome has
      ...
      07-20-2026, 11:48 AM
    • SEQadmin2
      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
      by SEQadmin2



      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
      ...
      07-09-2026, 11:10 AM
    • SEQadmin2
      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
      by SEQadmin2



      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
      07-08-2026, 05:17 AM

    ad_right_rmr

    Collapse

    News

    Collapse

    Topics Statistics Last Post
    Started by SEQadmin2, 07-24-2026, 12:17 PM
    0 responses
    34 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 07-23-2026, 11:41 AM
    0 responses
    25 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 07-20-2026, 11:10 AM
    0 responses
    217 views
    0 reactions
    Last Post SEQadmin2  
    Started by SEQadmin2, 07-13-2026, 10:26 AM
    0 responses
    81 views
    0 reactions
    Last Post SEQadmin2  
    Working...