brittneybrinsfield / pysam

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

Error loading 0.7.4 "Symbol not found: _getline" #122

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just installed 0.7.4. Seems like it installed successfully.

Upon importing pysam I get an error:

File 
"/Users/abuchanan/.virtualenvs/jeans/lib/python2.7/site-packages/pysam/__init__.
py", line 2, in <module>
  from pysam.ctabix import *

ImportError: 
dlopen(/Users/abuchanan/.virtualenvs/jeans/lib/python2.7/site-packages/pysam/cta
bix.so, 2): Symbol not found: _getline

Referenced from: 
/Users/abuchanan/.virtualenvs/jeans/lib/python2.7/site-packages/pysam/ctabix.so

Expected in: flat namespace
 in /Users/abuchanan/.virtualenvs/jeans/lib/python2.7/site-packages/pysam/ctabix.so

Running python 2.7.3 and pip in a virtualenv

Build and error log:
https://gist.github.com/abuchanan/5519746

Original issue reported on code.google.com by bucha...@gmail.com on 5 May 2013 at 4:44

GoogleCodeExporter commented 9 years ago
Hi, 

would you mind to try the attached patch (from my post here 
https://groups.google.com/forum/#!topic/pysam-user-group/XawyXY1zuHI)?

Andreas

Original comment by andreas....@gmail.com on 23 Jun 2013 at 2:16

Attachments:

GoogleCodeExporter commented 9 years ago
sorry, correct URL is 
https://groups.google.com/forum/#!topic/pysam-user-group/XawyXY1zuHI

Andreas

Original comment by andreas....@gmail.com on 23 Jun 2013 at 2:17

GoogleCodeExporter commented 9 years ago
Thanks for finding and solving the problem!

I have added the patch to the files tabix_util.c and tabix_util.h and thus 
should automatically effective and pushed the changes to the repository.

However, I have no means of testing this, if somebody could give it a go, that 
would be great!

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 26 Jun 2013 at 7:13

GoogleCodeExporter commented 9 years ago
I think it didn't work for me. Below is a log of my test on Mac OSX 10.6.8:

Verify issue exists
====================

pip install pysam

Downloading/unpacking pysam
  Downloading pysam-0.7.4.tar.gz (1.4MB): 1.4MB downloaded

... build log here ...

Successfully installed pysam cython

>>> import pysam

/Users/abuchanan/.virtualenvs/test-pysam/bin/python: 
dlopen(/Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysa
m/ctabix.so, 2): Symbol not found: _getline
  Referenced from: /Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysam/ctabix.so
  Expected in: flat namespace
 in /Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysam/ctabix.so; 'pysam' is a package and cannot be directly executed

pip uninstall pysam

Install from repo
==================

hg clone https://code.google.com/p/pysam/

python setup.py install

... build log here ...

>>> import pysam
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysam-0.7.5-py2.7-macosx-10.6-x86_64.egg/pysam/__init__.py", line 2, in <module>
    from pysam.ctabix import *
ImportError: 
dlopen(/Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysa
m-0.7.5-py2.7-macosx-10.6-x86_64.egg/pysam/ctabix.so, 2): Symbol not found: 
_getline
  Referenced from: /Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysam-0.7.5-py2.7-macosx-10.6-x86_64.egg/pysam/ctabix.so
  Expected in: flat namespace
 in /Users/abuchanan/.virtualenvs/test-pysam/lib/python2.7/site-packages/pysam-0.7.5-py2.7-macosx-10.6-x86_64.egg/pysam/ctabix.so

Original comment by bucha...@gmail.com on 26 Jun 2013 at 7:48

GoogleCodeExporter commented 9 years ago
Same problem here with the dist-tarball.

Inserting the getline function from the original patch directly into ctabix.c 
still works though.

Andreas

Original comment by andreas....@gmail.com on 19 Aug 2013 at 8:45

GoogleCodeExporter commented 9 years ago
Sorry, it seems I only added the changes to pysam_util.h, but not pysam_util.c.

Any luck now?

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 18 Sep 2013 at 7:48

GoogleCodeExporter commented 9 years ago
Hi Andreas,

I tried adding the patch file but got the following errors. Can you please help!

Thanks,
Reetu

sudo patch 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py
sam-0.7.5-py2.7-macosx-10.6-intel.egg/pysam/pysam_util.h 
/Users/aurelie/Desktop/Tools/pysam-0.7.5/pysam-0.7.4_getline-osx.patch 
patching file 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py
sam-0.7.5-py2.7-macosx-10.6-intel.egg/pysam/pysam_util.h
Hunk #1 FAILED at 12.
1 out of 1 hunk FAILED -- saving rejects to file 
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/py
sam-0.7.5-py2.7-macosx-10.6-intel.egg/pysam/pysam_util.h.rej

Original comment by Tuteja.R...@gmail.com on 20 Sep 2013 at 12:16

GoogleCodeExporter commented 9 years ago
Hi Reetu,

sorry, I don't think I have enough information. Possibly the version of pysam 
for the patch and the version that you applied it to are different?

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 24 Sep 2013 at 12:57

GoogleCodeExporter commented 9 years ago
I built/installed from a fresh clone of the source

(test-pysam)pysam$ hg summary
parent: 352:c848f9f245a8 tip
 tabix_util.h - added unistd include
branch: default
commit: 1 modified
update: (current)

I had some build errors, described in issue 138, but after getting it 
built/installed, I don't seem to get any import errors.

I ran pysam_test.py. It has numerous failures, possibly not related to this 
issue. Output is attached.

Original comment by bucha...@gmail.com on 8 Oct 2013 at 7:30

Attachments:

GoogleCodeExporter commented 9 years ago
The problem in the output is related that samtools in the path is older than 
the one wrapped in pysam. This is not a problem.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 26 Nov 2013 at 9:35