Open AlecThomson opened 11 months ago
On linux, using that last script, I get these errors:
~> python -c "from casatasks import tclean; from casacore.tables import table; print(tclean.__doc__); print(table.__doc__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casacore/tables/__init__.py", line 60, in <module>
from .msutil import *
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casacore/tables/msutil.py", line 29, in <module>
from casacore.tables.table import (table, taql,
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casacore/tables/table.py", line 40, in <module>
from ._tables import (Table,
ImportError: /home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casacore/tables/../../../../libcasa_python3.so.7: undefined symbol: _ZN8casacore6VectorIxSaIxEE6resizeERKNS_9IPositionEb
and
~> python -c "from casacore.tables import table; from casatasks import tclean; print(tclean.__doc__); print(table.__doc__)"
Traceback (most recent call last):
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/__casac__/image.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 1176, in create_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
ImportError: /home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/__casac__/lib/libcasa_fits.so.7: undefined symbol: _ZTIN8casacore5ArrayIhEE
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatasks/__init__.py", line 5, in <module>
from casatools import logsink as _logsink
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/__init__.py", line 43, in <module>
from .image import image
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/image.py", line 4, in <module>
from .__casac__.image import image as _image
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/__casac__/image.py", line 17, in <module>
_image = swig_import_helper()
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/site-packages/casatools/__casac__/image.py", line 16, in swig_import_helper
return importlib.import_module('_image')
File "/home/tho822/mambaforge/envs/casa_py310/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_image'
Hey all - just wondering if anyone has had a chance to look at this?
Tagging @gijzelaerr @tammojan for some visibility.
Hi, thanks for the ping. I think trying to have both the CASA python bindings and the python-casacore python bindings to casacore is near impossible. That is due to the underlying casacore. If you load two python bindings, two casacores will be loaded, but the symbols of these two will shadow each other. If the versions are binary incompatible (which is probably the case) this will in the best case lead to segfaults, in a good case you get the error on importing.
In theory this should be solvable, but on the short term we have no plans to work on this. So if you use casatools, you'd have to access the table also through casatools - or use a trick with multiple venvs or so.
Thanks so much @tammojan. Really appreciate the feedback on this. I'll give the casatools.table
functionality some testing to see if we can get things working.
Hi there,
Apologies if this is wrong stream to report this issue. Myself and @tjgalvin have had adventures trying to install both
python-casacore
andcasatasks
/casatools
on Python 3.10. I've been testing on MacOS Apple Silicon, but @tjgalvin has had similar results on linux.First, installation with
pip
alone does not seem to work. I needed to resort to using a conda install. There are also issues withcasatasks
/casatools
and how it handlesmatplotlib
- it seems to be have been built againstmatplotlib<=3.5.1
and newer versions break.Here is summary of my first stages of installation trials with minimal conda installs:
Next I resorted to the
conda-forge
build. This can seemingly work, but the order of imports matters withcasatasks
/casatools
: