Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new casac fails to find libicuuc.so.54 #3

Closed
caseyjlaw opened this issue Aug 6, 2016 · 23 comments
Closed

new casac fails to find libicuuc.so.54 #3

caseyjlaw opened this issue Aug 6, 2016 · 23 comments

Comments

@caseyjlaw
Copy link

I am working with conda at the AOC. There, I have two environments for using pwkit to get access to casac. The newly-updated one how produces this error when importing casac:

(test) gygax$ python -c 'import casac'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/users/claw/miniconda/envs/test/lib/python2.7/site-packages/casac.py", line 1, in <module>
    import __casac__
  File "/users/claw/miniconda/envs/test/lib/python2.7/site-packages/__casac__/__init__.py", line 49, in <module>
    import atmosphere
  File "/users/claw/miniconda/envs/test/lib/python2.7/site-packages/__casac__/atmosphere.py", line 28, in <module>
    _atmosphere = swig_import_helper()
  File "/users/claw/miniconda/envs/test/lib/python2.7/site-packages/__casac__/atmosphere.py", line 24, in swig_import_helper
    _mod = imp.load_module('_atmosphere', fp, pathname, description)
ImportError: libicuuc.so.54: cannot open shared object file: No such file or directory

After some fiddling with version numbers of casa/pwkit, it seems that a recent update to casa is the problem. Here are the casa/pwkit versions that fail:

(test) gygax$ conda list | egrep 'casa|pwkit'
casa-data                 r10774                        0    pkgw/channel/main
casa-nrao-casacore        4.6.0                         1    pkgw/channel/main
casa-python               4.6.0                    py27_2    pkgw/channel/main
casa-tools                4.6.0                         2    pkgw/channel/main
pwkit                     0.8.2                     <pip>

And a test in my still-working casac environment:

(test) gygax$ source activate development
(development) gygax$ python -c 'import casac'
(development) gygax$ conda list | egrep 'casa|pwkit'
casa-data                 r10774                        0    pkgw/channel/main
casa-nrao-casacore        4.6.0                         0    pkgw/channel/main
casa-python               4.6.0                    py27_1    pkgw/channel/main
casa-tools                4.6.0                         1    pkgw/channel/main
pwkit                     0.8.2                     <pip>
@pkgw
Copy link
Owner

pkgw commented Aug 7, 2016

There may have been a dependency resolution failure here. You should have an "icu" package at version 54.1 that provides that library. But there's an annoying thing where Anaconda's "boost" packages require a newer version of icu that they don't actually provide! So your broken tree might be wedged in a state where ICU is not installed. Can you see if icu and/or boost are installed, and what versions they're at?

(See anaconda-issues#700).

@caseyjlaw
Copy link
Author

Yes, that seems to be the issue. My working casac environment has:

nmpost-master$ conda list | egrep 'icu|boost'
boost                     1.57.0                        4  
icu                       54.1                          0  

The most up to date one has icu 56.1.
FWIW, I am using conda-forge and 56.1 seems to be coming from there. Does that affect how you report the issue?

@caseyjlaw
Copy link
Author

Has this issue been resolved? I ran 'conda update --all' and have gotten myself into dependency hell.

gygax$ conda list | egrep 'casa|pwkit|icu|boost'
boost                     1.57.0                        4  
icu                       54.1                          0  
casa-data                 r10892                        0    pkgw/channel/main
casa-nrao-casacore        4.6.0                         1    pkgw/channel/main
casa-python               4.6.0                    py27_2    pkgw/channel/main
casa-tools                4.6.0                         2    pkgw/channel/main
pwkit                     0.8.4.99                  <pip>

but importing casac gives:

ImportError: libicui18n.so.56: cannot open shared object file: No such file or directory

From our earlier discussion, I would have thought that would be adequate. Downgrading 'casa-python' to 4.5.2, then leads to a series of other errors, such as:

ImportError: libalma.so.45.0.0: cannot open shared object file: No such file or directory

and then downgrading 'casa-tools' to 4.5.2:

ImportError: libsakura.so.1: cannot open shared object file: No such file or directory

Any thoughts?

@caseyjlaw caseyjlaw reopened this Sep 3, 2016
@caseyjlaw
Copy link
Author

It seems that something in casa-python is still looking for icu-56? Not clear how, but when I make my own symlinks into my conda environment, the import works. Here's the nominal set of versions (with icu-56 linked in by hand beside the icu-54 libraries):

gygax$ conda list | egrep 'boost|icu|casa|pwkit'
boost                     1.57.0                        4  
icu                       54.1                          0  
casa-data                 r10892                        0    pkgw/channel/main
casa-nrao-casacore        4.6.0                         0    pkgw/channel/main
casa-python               4.6.0                    py27_1    pkgw/channel/main
casa-tools                4.6.0                         1    pkgw/channel/main
pwkit                     0.8.4.99                  <pip>

@pkgw
Copy link
Owner

pkgw commented Sep 5, 2016

Sorry, I never really worked on addressing this. I highly suspect that conda-forge is responsible for the issues here. Conda-forge seems to be the direction that things are going so I think I just have to bite the bullet and start working on making all of my stuff compatible with it. Have you had any problems with it?

@caseyjlaw
Copy link
Author

Your channel and conda-forge are my two extra channels and I have not had a problem before. I see that boost and icu are currently being picked up from anaconda directly at the moment, so maybe there is a way to set priorities on what channel is used first?

@pkgw
Copy link
Owner

pkgw commented Sep 5, 2016

I believe there are mechanisms to affect priorities between channels, but based on my understanding of the situation it will make a lot of sense for me to work towards basing things on conda-forge. (And, eventually, submitting my packages directly there.)

OK, basic question: you were able to get things into a working state, right? There are other things that I ought to prioritize these days, but if this is really making you stuck, I want to fix that.

@caseyjlaw
Copy link
Author

I am up and running after linking in some icu libraries by hand. Not pretty, but your job applications definitely take priority!

@caseyjlaw
Copy link
Author

I wanted to raise this again, in case there was an easy solution. I am about to release new data that will be a great demonstration of my rtpipe and your pwkit code. Unfortunately, I am still having trouble with a simple install to get access to casac in Python.
My current instructions are:
> conda install -c conda-forge numpy scipy jupyter bokeh cython matplotlib
> conda install -c pkgw pwkit casa-tools casa-python casa-data

But the first line grabs icu v56, which is too high and the dependency is not properly handled to downgrade for the second line.
What is the proper way to install scipy etc that avoids this issue?

@pkgw
Copy link
Owner

pkgw commented Dec 12, 2016

As it happens, just today I took a look at porting my packages over to conda-forge. I don't think I can switch everything over as quickly as I'd like, but I have some ideas about making my stuff more compatible. I appreciate your persistence! Updates soon, I hope.

@pkgw
Copy link
Owner

pkgw commented Dec 16, 2016

Casey, for your demos and needs, do you absolutely need conda-forge as a dependency? For the time being, it is going to be easiest to avoid mixing and matching their repo and mine.

I have started the work of importing my projects into conda-forge, which is clearly the sensible long-term solution. They have been quite helpful so far but it will take some time to bring everything in.

@pkgw
Copy link
Owner

pkgw commented Dec 16, 2016

I should add that I might be able to create a channel that builds my stuff aiming for compatibility with conda-forge. At a minimum it will take a fair amount of effort, though, and if there are disagreeing choices with certain core packages it might not be possible to make them compatible.

@caseyjlaw
Copy link
Author

I don't think conda-forge is a requirement. I thought it was good practice, but I'll back that change out for now.

@pkgw
Copy link
Owner

pkgw commented Dec 16, 2016

Well, I'm taking a look and I think I can make and distribute a subset of packages that are based on conda-forge. Let me get back to you in a few hours.

@pkgw
Copy link
Owner

pkgw commented Dec 16, 2016

Try installing from the pkgw-forge channel rather than just pkgw. It should provide casa-python and pwkit in a way that is compatible with — and, in fact, requires — conda-forge. When I tested it, something strange happened where I had to explicitly tell it to upgrade to boost version 1.62.0 in order for everything to get synched up, though.

I've only made builds for linux-64 but this was straightforward enough that OSX should also be doable.

@caseyjlaw
Copy link
Author

caseyjlaw commented Dec 16, 2016 via email

@pkgw
Copy link
Owner

pkgw commented Dec 17, 2016

So, that dbus warning is fine and can be ignored.

The message about "no module named _atmosphere" is actually indicating that some of the dependent libraries aren't aligned. You should have boost = 1.62.0 and icu = 1.56.1, so try conda install boost=1.62.0 (plus any flags to get the custom channels you need).

@caseyjlaw
Copy link
Author

caseyjlaw commented Dec 19, 2016 via email

@pkgw
Copy link
Owner

pkgw commented Dec 20, 2016

Well, if you start with a fresh installation and add conda-forge and pkgw-forge as channels, it should work to just install casa-data and casa-python ... but unfortunately Conda's dependency resolver sometimes makes some strange choices.

Casey, if your cool data demonstration is going to include instructions to get the requisite software stack installed, I would like to help make them as easy as possible. I am happy to do a test-run in a test environment, and if there are any problems I will see if there are ways to update the packaging to make things more robust.

By the way, I uploaded OSX builds of casa-python and friends to pkgw-forge — haven't tested extensively but I think that's all working.

@pkgw
Copy link
Owner

pkgw commented Dec 20, 2016

Oh yeah also we're getting kind of far afield from what this issue was originally about. I'm going to close it; you know how to reach me if there's more to discuss!

@mtazzari
Copy link

mtazzari commented Feb 12, 2019

First, @pkgw thanks so much for developing the casa-python and casa-data wrappers for CASA, they are really useful!
I have just stumbled upon the same issue discussed here. Today I created a new conda environment and withcasa-python and casa-data and my configuration broke.
Full traceback:

Python 3.6.7 | packaged by conda-forge | (default, Nov 21 2018, 03:09:43)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import casac
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/__casac__/atmosphere.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/opt/conda/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /opt/conda/lib/python3.6/site-packages/__casac__/../../../libcasadbus.so.54.0.0: undefined symbol: _ZN4DBus14InterfaceProxyC2ERKSs

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/conda/lib/python3.6/site-packages/casac.py", line 1, in <module>
    import __casac__
  File "/opt/conda/lib/python3.6/site-packages/__casac__/__init__.py", line 54, in <module>
    from . import atmosphere
  File "/opt/conda/lib/python3.6/site-packages/__casac__/atmosphere.py", line 17, in <module>
    _atmosphere = swig_import_helper()
  File "/opt/conda/lib/python3.6/site-packages/__casac__/atmosphere.py", line 16, in swig_import_helper
    return importlib.import_module('_atmosphere')
  File "/opt/conda/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_atmosphere'

This is the problematic configuration:

$ conda list | egrep 'boost|icu|casa|pwkit'
boost                     1.68.0          py36h8619c78_1001    conda-forge
boost-cpp                 1.68.0            h11c811c_1000    conda-forge
casa-data                 r20180919                     0    pkgw-forge
casa-python               5.4.1            py36hc5275ef_0    pkgw-forge
casa-tools                5.4.1                h6c11689_1    pkgw-forge
casacore                  2.4.2a0          py36he20af57_1    conda-forge
icu                       58.2              hf484d3e_1000    conda-forge

It appears to me as well that the issue comes from the builds of icu, boost, and boost-cpp picked by conda from conda-forge.
For example, today conda picked the latest boost build that was pushed to anaconda/conda-forge/ 30 hours ago. I did not tracked down conclusively whether the problem was just boost, or icu or boost-cpp, or all of them together (e.g., one problematic build triggering installation of problematic builds of the other packages).
For the time being I solved by saving to file the packages in a conda environment where casac worked.
Obvious downside of this solution is that my dependencies are frozen at the moment.
This configuration works for me:

$ conda list | egrep 'boost|icu|casa|pwkit'
boost                     1.68.0           py36h3e44d54_1    conda-forge
boost-cpp                 1.68.0               h3a22d5f_0    conda-forge
casa-data                 r20180919                     0    pkgw-forge
casa-python               5.4.1            py36hc5275ef_0    pkgw-forge
casa-tools                5.4.1                h6c11689_1    pkgw-forge
casacore                  2.4.2a0          py36he20af57_1    conda-forge
icu                       58.2                 hfc679d8_0    conda-forge

I think it would be a huge contribution to have casa-python and casa-data in conda-forge to allow seamless integration!

@pkgw
Copy link
Owner

pkgw commented Feb 12, 2019

@mtazzari Thanks for the detailed report!

Are you able to upgrade to Python 3.7? I just recently released new versions of the packages to add support for 3.7, and part of that update process involved synchronizing them with the latest conda-forge dependencies. I suspect that updating everything might fix your problem. For reference, here are the versions for my install:

$ conda list | egrep 'boost|icu|casa|pwkit'
boost                     1.68.0          py37h8619c78_1001    conda-forge
boost-cpp                 1.68.0            h11c811c_1000    conda-forge
casa-data                 r20180919                     0    pkgw-forge
casa-python               5.4.1            py37h10622fb_2    pkgw-forge
casa-tools                5.4.1                h738cfa5_2    pkgw-forge
casacore                  2.4.2a0         py37hfc3e434_1004    conda-forge
icu                       58.2              hf484d3e_1000    conda-forge
pwkit                     0.8.20.99                 dev_0    <develop>

If you're stuck on 3.6, I should be able to make a new build for that version too. It will just take a while to compile everything.

Relatedly, the main reason these packages aren't in conda-forge is that they take too long to build in the CI systems. However, the project is right now looking into migrating some builds onto the Azure Pipelines system, which supports much longer build timeouts. So we might be able to make more of these packages official in the near future!

@mtazzari
Copy link

Fantastic! I have been able to upgrade my stack to Python 3.7 and it all works again! Thank you!
I now have the same versions reported by your conda list above.

I see the complication with getting the packages in conda-forge. I have GALARIO on conda-forge and the latest conda-smithy updates moved most if not all the builds on Azure. See the tests of the last commit in the galario feedstock, https://github.com/conda-forge/galario-feedstock
Looking forward to seeing casa-python and casa-data in conda-forge hopefully soon! :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants