ratt-ru / meqtrees-timba

software system for implementing and solving arbitrary Measurement Equations
4 stars 5 forks source link

pkg_resources doesn't work under MeqTrees #34

Closed o-smirnov closed 7 years ago

o-smirnov commented 7 years ago

OK, we have a serious degradation on 16.04. I can't import scripts into the browser, things bomb out with:

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/Timba/TDL/Compile.py", line 136, in import_tdl_module
    _tdlmod = imp.load_source(modname,filename,infile);
  File "/home/oms/meqtrees-cattery/test/Batchtest/testing-sim.py", line 69, in <module>
    meqmaker.add_sky_models([gridded_sky,transient_sky,fitsimage_sky,lsm,TiggerSkyModel(verbose=2)]);
  File "/home/oms/Cattery/Siamese/OMS/tigger_lsm.py", line 44, in TiggerSkyModel
    classobj = importTigger(verbose=verbose);
  File "/home/oms/Cattery/Siamese/OMS/tigger_lsm.py", line 13, in importTigger
    import Tigger
  File "/usr/lib/python2.7/dist-packages/Tigger/__init__.py", line 35, in <module>
    import pkg_resources
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 46, in <module>
    from pkg_resources.extern import six
  File "/usr/lib/python2.7/dist-packages/pkg_resources/extern/__init__.py", line 43, in load_module
    mod = sys.modules[extant]
AttributeError: 'NoneType' object has no attribute 'modules'

Funny thing is, import Tigger by itself from Python is fine. It's under MeqTrees that pkg_resources goes pear-shaped. @gijzelaerr, any bright ideas? This looks a little familiar...

o-smirnov commented 7 years ago

Aha, this is why it's familiar: https://github.com/ska-sa/tigger/issues/74

gijzelaerr commented 7 years ago

not sure if the 2 problems are related.

Are you using the python-tigger package? That package is working fine for me on 16.04.

gijzelaerr commented 7 years ago

by the way, what do you mean with 'into the browser'. Not Jupyter notebooks right?

gijzelaerr commented 7 years ago

@o-smirnov are you using the python-tigger package? I doesn't look like it, the backtrace shows python modules are used from your home folder.

gijzelaerr commented 7 years ago

actually it looks like you are mixing a local and package installation.

gijzelaerr commented 7 years ago

@o-smirnov can you elaborate.

gijzelaerr commented 7 years ago

ok we are not the only one https://github.com/pypa/setuptools/issues/508

gijzelaerr commented 7 years ago

ok this is a bug in an old setuptools bunlded with ubuntu 16.04. can't really fix that, so we worked around it by manually setting the version in the package. closing this issue.