linnarsson-lab / loom-viewer

Tool for sharing, browsing and visualizing single-cell data stored in the Loom file format
BSD 2-Clause "Simplified" License
35 stars 6 forks source link

import fail on Ubuntu #68

Closed gioelelm closed 7 years ago

gioelelm commented 7 years ago

When I do import loom on Sanger, I get the following error:

Any idea why?


ImportErrorTraceback (most recent call last)
<ipython-input-6-d7c1c8d2b116> in <module>()
----> 1 import loompy as lp

/home/gioele/anaconda2/envs/bigproject/lib/python2.7/site-packages/loompy/__init__.py in <module>()
      2 from .loom_cache import LoomCache
      3 from .loom_pipeline import LoomPipeline
----> 4 from .loom_server import start_server
      5 from ._version import __version__

/home/gioele/anaconda2/envs/bigproject/lib/python2.7/site-packages/loompy/loom_server.py in <module>()
     20 import inspect
     21 import time
---> 22 from loompy import LoomCache
     23 from wsgiref.handlers import format_date_time
     24 

ImportError: cannot import name LoomCache
gioelelm commented 7 years ago

I seem to have temporarily resolved on my local installation removing this two lines,

from .loom_cache import LoomCache
from .loom_server import start_server

this probably breaks most of loom functionality but the loompy parsers are ok

JobLeonard commented 7 years ago

Has this been resolved, @gioelelm?

gioelelm commented 7 years ago

The hack is to comment out this lines in python 2.7. According the documentation should be possibile to fix this by adding this line at the beginning of the init.py file:

from __future__ import absolute_import

I haven't had the time to test it though...

gioelelm commented 7 years ago

For future references of this kind of problem this resource is fantastic: http://python-future.org/compatible_idioms.html

JobLeonard commented 7 years ago

I think this has now been resolved by splitting the packages