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

ImportError: libicui18n.so.58 when importing Obspy (Anaconda) #1677

Closed
elmerehbi opened this issue Feb 20, 2017 · 18 comments
Closed

ImportError: libicui18n.so.58 when importing Obspy (Anaconda) #1677

elmerehbi opened this issue Feb 20, 2017 · 18 comments
Labels
external It's not our fault! installation issues with installing obspy packaging issue related to our packaging efforts (e.g. conda, Debian, ...) question Questions asked by users. Please use https://discourse.obspy.org for asking new questions
Milestone

Comments

@elmerehbi
Copy link

elmerehbi commented Feb 20, 2017

traceback.txt
I installed ObsPy using conda as outlined in the Wiki. When I import it I get the following error (after the tracback):

import obspy as op
or
from obspy import read

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

  • ObsPy version: 1.0.2
  • Python version: Python 3.5.3 (Anacondaa)
  • Platform: Ubuntu 16.04 (Gnome)

Traceback is attached

@megies
Copy link
Member

megies commented Feb 20, 2017

This seems to be a packaging problem by anaconda that is not related to obspy. See conda-forge/conda-forge.github.io#326 (comment):

The workaround for now is to explicitly define a dependency on icu 56.* to get the older packages.
(Or wait until I finish the pinnings, which hopefully will happen this weekend.)

So, $ conda install 'icu=56.*' should do it for now..

@megies megies added external It's not our fault! installation issues with installing obspy packaging issue related to our packaging efforts (e.g. conda, Debian, ...) question Questions asked by users. Please use https://discourse.obspy.org for asking new questions labels Feb 20, 2017
@elmerehbi
Copy link
Author

elmerehbi commented Feb 22, 2017

@megies The command to install icu 56.* doesn't work.
In zsh I get a no matches found

zsh: no matches found: 56.*

I understand this is a zsh issue but running in bash I get:

PackageNotFoundError: Package not found: '' Package missing in current linux-64 channels: - 56.*

@megies
Copy link
Member

megies commented Feb 22, 2017

Ah sorry, try this: $ conda install 'icu=56.*'

@elmerehbi
Copy link
Author

It doesn't work.
Since per my last comment I had matplotlib import issue too. Having installed another module it fixed the matplotlib problem.

Trying your command doesn't work. It returns a conflict:

UnsatisfiableError: The following specifications were found to be in conflict: - icu 56.*

@megies
Copy link
Member

megies commented Feb 22, 2017

Can you try with a fresh new environment?

$ conda create -n new_env python=2.7
$ source activate new_env
$ conda config --add channels conda-forge
$ conda install obspy 'icu=56.*'

@tychoaussie
Copy link

tychoaussie commented Feb 25, 2017

Huge problems on this end, too. I'm beginning to panic. My main system is now down after trying a "conda update obspy". Today I tried my laptop and it too, is down: I can't even launch Python or Ipython notebooks. I didn't even do any updates and it used to work just a few weeks ago! I have work to do on Monday and no operational platforms at this point. How does the fresh new environment work? Does it replace the old environment? - I'm almost afraid of trying it for fear of breaking something worse!

@elmerehbi
Copy link
Author

elmerehbi commented Feb 25, 2017

@megies The problem persists.

Also, though you specified using Python 2.7 (I am working with Anaconda 3) when I open Ipython I still get:

Python 3.5.2

I have an export line in my zshrc which Anaconda usually puts in bashrc.

@tychoaussie Are you using Anaconda?
If so you can just create a new environment** if you don't have one and switch between them:

conda create -n <environment-name>
source activate <environment-name>

Here's conda's docs

As for this (broken) environment you might want to try to update all modules instead of a single one. This is preferred. Also precede that by updating conda:

source deactivate
conda update conda
source activate <environment-name>
conda update ---all

** The idea of environment is to have different setups. Each environment is (afaik) independent of the other except for the base python installation. In other words, each environment can have different modules installed. When you have a certain environment (env for short) activated any modules that you install go into that env. If no env is activated then the installations/updates are in the main env.

@QuLogic
Copy link
Member

QuLogic commented Feb 26, 2017

Please post the output of conda list.

@megies
Copy link
Member

megies commented Feb 26, 2017

Also $ conda info output for debugging. And of course the traceback that shows the problem, e.g. $ python -c 'import obspy' if already importing obspy crashes.

@megies
Copy link
Member

megies commented Feb 26, 2017

Also, though you specified using Python 2.7 (I am working with Anaconda 3) when I open Ipython I still get:

If you have an environment that doesn't have IPython installed but your root environment has IPython, your shell will start IPython in root environment. That's something you should keep in mind.

I would in general advise to keep the root environment as bare as possible and only use it for handling other environments via conda commands.

@megies
Copy link
Member

megies commented Feb 26, 2017

I'm beginning to panic.

Post some error messages and conda debug output as stated above and we can try to help. But we need this input to work with..

@megies
Copy link
Member

megies commented Feb 26, 2017

I can reproduce those problems with icu/matplotlib..

If I do the following:

$ conda install 'matplotlib<2' 'icu=56.*'
$ python -c 'import obspy'

then I'm running into problems:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/megies/anaconda/envs/icu_problem/lib/python2.7/site-packages/obspy/__init__.py", line 40, in <module>
    from obspy.core.utcdatetime import UTCDateTime  # NOQA
  File "/home/megies/anaconda/envs/icu_problem/lib/python2.7/site-packages/obspy/core/__init__.py", line 119, in <module>
    from obspy.core.utcdatetime import UTCDateTime
  File "/home/megies/anaconda/envs/icu_problem/lib/python2.7/site-packages/obspy/core/utcdatetime.py", line 20, in <module>
    from obspy.core.util.decorator import deprecated
  File "/home/megies/anaconda/envs/icu_problem/lib/python2.7/site-packages/obspy/core/util/__init__.py", line 41, in <module>
    from obspy.core.util.testing import add_doctests, add_unittests
  File "/home/megies/anaconda/envs/icu_problem/lib/python2.7/site-packages/obspy/core/util/testing.py", line 28, in <module>
    from lxml import etree
ImportError: libicui18n.so.58: cannot open shared object file: No such file or directory

Conda list for this problematic package set:

backports_abc             0.5                      py27_0    conda-forge
ca-certificates           2017.1.23                     0    conda-forge
cairo                     1.14.6                        0    conda-forge
certifi                   2017.1.23                py27_0    conda-forge
cycler                    0.10.0                   py27_0    conda-forge
decorator                 4.0.11                   py27_0    conda-forge
fontconfig                2.11.1                        6    conda-forge
freetype                  2.6.3                         1    conda-forge
funcsigs                  1.0.2                    py27_0    conda-forge
functools32               3.2.3.2                  py27_1    conda-forge
future                    0.16.0                   py27_0    conda-forge
gettext                   0.19.7                        1    conda-forge
glib                      2.51.0                        2    conda-forge
harfbuzz                  1.3.4                         0    conda-forge
icu                       56.1                          4    conda-forge
jpeg                      9b                            0    conda-forge
libffi                    3.2.1                         3    conda-forge
libgfortran               3.0.0                         1  
libiconv                  1.14                          4    conda-forge
libpng                    1.6.28                        0    conda-forge
libtiff                   4.0.6                         7    conda-forge
libxml2                   2.9.4                         3    conda-forge
libxslt                   1.1.29                        3    conda-forge
lxml                      3.7.2                    py27_1    conda-forge
matplotlib                1.5.3               np111py27_5    conda-forge
mkl                       2017.0.1                      0  
mock                      2.0.0                    py27_0    conda-forge
ncurses                   5.9                          10    conda-forge
numpy                     1.11.3                   py27_0  
obspy                     1.0.2                    py27_1    conda-forge
openssl                   1.0.2h                        3    conda-forge
pango                     1.40.3                        0    conda-forge
pbr                       1.10.0                   py27_0    conda-forge
pcre                      8.39                          0    conda-forge
pip                       9.0.1                    py27_0    conda-forge
pixman                    0.34.0                        0    conda-forge
pyparsing                 2.1.10                   py27_0    conda-forge
pyqt                      4.11.4                   py27_2    conda-forge
python                    2.7.12                        2    conda-forge
python-dateutil           2.6.0                    py27_0    conda-forge
pytz                      2016.10                  py27_0    conda-forge
qt                        4.8.7                         3    conda-forge
readline                  6.2                           0    conda-forge
requests                  2.13.0                   py27_0    conda-forge
scipy                     0.18.1              np111py27_1  
setuptools                33.1.0                   py27_0    conda-forge
singledispatch            3.4.0.3                  py27_0    conda-forge
sip                       4.18                     py27_1    conda-forge
six                       1.10.0                   py27_1    conda-forge
sqlalchemy                1.1.5                    py27_0    conda-forge
sqlite                    3.13.0                        1    conda-forge
ssl_match_hostname        3.5.0.1                  py27_0    conda-forge
subprocess32              3.2.7                    py27_0    conda-forge
tk                        8.5.19                        1    conda-forge
tornado                   4.4.2                    py27_0    conda-forge
wheel                     0.29.0                   py27_0    conda-forge
xz                        5.2.2                         0    conda-forge
zlib                      1.2.11                        0    conda-forge

What works for me is this:

conda install 'matplotlib<2' 'icu=58.*'

Working set of packages:

backports_abc             0.5                      py27_0    conda-forge
ca-certificates           2017.1.23                     0    conda-forge
cairo                     1.14.6                        4    conda-forge
certifi                   2017.1.23                py27_0    conda-forge
cycler                    0.10.0                   py27_0    conda-forge
decorator                 4.0.11                   py27_0    conda-forge
fontconfig                2.12.1                        4    conda-forge
freetype                  2.7                           1    conda-forge
funcsigs                  1.0.2                    py27_0    conda-forge
functools32               3.2.3.2                  py27_1    conda-forge
future                    0.16.0                   py27_0    conda-forge
gettext                   0.19.7                        1    conda-forge
glib                      2.51.0                        2    conda-forge
harfbuzz                  1.3.4                         2    conda-forge
icu                       58.1                          1    conda-forge
jpeg                      9b                            0    conda-forge
libffi                    3.2.1                         3    conda-forge
libgfortran               3.0.0                         1  
libiconv                  1.14                          4    conda-forge
libpng                    1.6.28                        0    conda-forge
libtiff                   4.0.6                         7    conda-forge
libxml2                   2.9.4                         4    conda-forge
libxslt                   1.1.29                        3    conda-forge
lxml                      3.7.2                    py27_1    conda-forge
matplotlib                1.5.3               np111py27_7    conda-forge
mkl                       2017.0.1                      0  
mock                      2.0.0                    py27_0    conda-forge
ncurses                   5.9                          10    conda-forge
numpy                     1.11.3                   py27_0  
obspy                     1.0.2                    py27_1    conda-forge
openssl                   1.0.2h                        3    conda-forge
pango                     1.40.3                        3    conda-forge
pbr                       1.10.0                   py27_0    conda-forge
pcre                      8.39                          0    conda-forge
pip                       9.0.1                    py27_0    conda-forge
pixman                    0.34.0                        0    conda-forge
pyparsing                 2.1.10                   py27_0    conda-forge
pyqt                      4.11.4                   py27_2    conda-forge
python                    2.7.12                        2    conda-forge
python-dateutil           2.6.0                    py27_0    conda-forge
pytz                      2016.10                  py27_0    conda-forge
qt                        4.8.7                         7    conda-forge
readline                  6.2                           0    conda-forge
requests                  2.13.0                   py27_0    conda-forge
scipy                     0.18.1              np111py27_1  
setuptools                33.1.0                   py27_0    conda-forge
singledispatch            3.4.0.3                  py27_0    conda-forge
sip                       4.18                     py27_1    conda-forge
six                       1.10.0                   py27_1    conda-forge
sqlalchemy                1.1.5                    py27_0    conda-forge
sqlite                    3.13.0                        1    conda-forge
ssl_match_hostname        3.5.0.1                  py27_0    conda-forge
subprocess32              3.2.7                    py27_0    conda-forge
tk                        8.5.19                        1    conda-forge
tornado                   4.4.2                    py27_0    conda-forge
wheel                     0.29.0                   py27_0    conda-forge
xz                        5.2.2                         0    conda-forge
zlib                      1.2.11                        0    conda-forge

N.b.: I have conda-forge channel in my ~/.condarc

$ cat ~/.condarc
channels:
  - conda-forge
  - defaults
  - obspy

Also compare some failing CI builds in conda-forge/obspy-feedstock#6.

@tychoaussie
Copy link

tychoaussie commented Feb 26, 2017

/users/Daniel/.condarac contains:

`ssl_verify: 'True'
channels:

  • conda-forge
  • obspy
  • anaconda-fusion
  • defaults`

C:\WINDOWS\system32>conda config --add channels conda-forge

C:\WINDOWS\system32>conda config --add channels obspy

C:\WINDOWS\system32>conda install obspy
Fetching package metadata .........An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

https://github.com/conda/conda/issues

Current conda install:

           platform : win-64
      conda version : 4.3.8
   conda is private : False
  conda-env version : 4.3.8
conda-build version : not installed
     python version : 2.7.13.final.0
   requests version : 2.12.4
   root environment : C:\ProgramData\Anaconda2  (writable)
default environment : C:\ProgramData\Anaconda2
   envs directories : C:\ProgramData\Anaconda2\envs
      package cache : C:\ProgramData\Anaconda2\pkgs
       channel URLs : https://conda.anaconda.org/obspy/win-64
                      https://conda.anaconda.org/obspy/noarch
                      https://conda.anaconda.org/conda-forge/win-64
                      https://conda.anaconda.org/conda-forge/noarch
                      https://conda.anaconda.org/anaconda-fusion/win-64
                      https://conda.anaconda.org/anaconda-fusion/noarch
                      https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/win-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : C:\Users\Daniel\.condarc
       offline mode : False
         user-agent : conda/4.3.8 requests/2.12.4 CPython/2.7.13 Windows/10 Windows/10.0.14393

$ C:\ProgramData\Anaconda2\Scripts\conda-script.py install obspy

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\exceptions.py", line 617, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main.py", line 137, in _main
    exit_code = args.func(args, p)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 80, in execute
    install(args, parser, 'install')
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\install.py", line 210, in install
    unknown=index_args['unknown'], prefix=prefix)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 120, in get_index
    index = fetch_index(channel_priority_map, use_cache=use_cache)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 445, in fetch_index
    repodatas = _collect_repodatas(use_cache, urls)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 433, in _collect_repodatas
    repodatas = _collect_repodatas_serial(use_cache, urls)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 401, in _collect_repodatas_serial
    for url in urls]
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 141, in func
    res = f(*args, **kwargs)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 391, in fetch_repodata
    with open(cache_path, 'w') as fo:
IOError: [Errno 13] Permission denied: u'C:\\ProgramData\\Anaconda2\\pkgs\\cache\\2116b818.json'

C:\WINDOWS\system32>conda install obspy 'icu=56.*'
Fetching package metadata .........An unexpected error has occurred.
Please consider posting the following information to the
conda GitHub issue tracker at:

https://github.com/conda/conda/issues

Current conda install:

           platform : win-64
      conda version : 4.3.8
   conda is private : False
  conda-env version : 4.3.8
conda-build version : not installed
     python version : 2.7.13.final.0
   requests version : 2.12.4
   root environment : C:\ProgramData\Anaconda2  (writable)
default environment : C:\ProgramData\Anaconda2
   envs directories : C:\ProgramData\Anaconda2\envs
      package cache : C:\ProgramData\Anaconda2\pkgs
       channel URLs : https://conda.anaconda.org/obspy/win-64
                      https://conda.anaconda.org/obspy/noarch
                      https://conda.anaconda.org/conda-forge/win-64
                      https://conda.anaconda.org/conda-forge/noarch
                      https://conda.anaconda.org/anaconda-fusion/win-64
                      https://conda.anaconda.org/anaconda-fusion/noarch
                      https://repo.continuum.io/pkgs/free/win-64
                      https://repo.continuum.io/pkgs/free/noarch
                      https://repo.continuum.io/pkgs/r/win-64
                      https://repo.continuum.io/pkgs/r/noarch
                      https://repo.continuum.io/pkgs/pro/win-64
                      https://repo.continuum.io/pkgs/pro/noarch
                      https://repo.continuum.io/pkgs/msys2/win-64
                      https://repo.continuum.io/pkgs/msys2/noarch
        config file : C:\Users\Daniel\.condarc
       offline mode : False
         user-agent : conda/4.3.8 requests/2.12.4 CPython/2.7.13 Windows/10 Windows/10.0.14393

$ C:\ProgramData\Anaconda2\Scripts\conda-script.py install obspy 'icu=56.*'

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\exceptions.py", line 617, in conda_exception_handler
    return_value = func(*args, **kwargs)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main.py", line 137, in _main
    exit_code = args.func(args, p)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\main_install.py", line 80, in execute
    install(args, parser, 'install')
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\cli\install.py", line 210, in install
    unknown=index_args['unknown'], prefix=prefix)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 120, in get_index
    index = fetch_index(channel_priority_map, use_cache=use_cache)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 445, in fetch_index
    repodatas = _collect_repodatas(use_cache, urls)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 433, in _collect_repodatas
    repodatas = _collect_repodatas_serial(use_cache, urls)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 401, in _collect_repodatas_serial
    for url in urls]
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 141, in func
    res = f(*args, **kwargs)
  File "C:\ProgramData\Anaconda2\lib\site-packages\conda\core\index.py", line 391, in fetch_repodata
    with open(cache_path, 'w') as fo:
IOError: [Errno 13] Permission denied: u'C:\\ProgramData\\Anaconda2\\pkgs\\cache\\2116b818.json'

C:\WINDOWS\system32>

@tychoaussie
Copy link

With the patient help of Tobias Megies, I have managed to rebuild the Anaconda package, and now have revived Obspy 1.0.2. It is working now, both on command line, and within the new Anaconda Navigator's Jupyter. I have created a working environment called 'new' such that the root environment should be preserved in case I break something. In Anaconda Navigator, I activated the new environment, installed Jupyter within that environment, and then activated the Obspy channel within the navigator. Now I can run my utilities, and develop code within the web interface. On Monday I will repair my work computer, and validate our suite of utilities & data converters to make sure that they still work.

In short, - Crisis seems to be over. Thanks, Tobias!

@QuLogic
Copy link
Member

QuLogic commented Feb 26, 2017

If I do the following:

$ conda install 'matplotlib<2' 'icu=56.*'
$ python -c 'import obspy'

then I'm running into problems:

There's also libxslt that a) erroneously links to libicu.so.* and b) doesn't have any pinning. So add conda install libxslt=1.1.29=2 to that list and I think it should work again.

@megies
Copy link
Member

megies commented Feb 26, 2017

There's also libxslt that a) erroneously links to libicu.so.* and b) doesn't have any pinning. So add conda install libxslt=1.1.29=2 to that list and I think it should work again.

@QuLogic what do you think should we do pinning-wise for our conda packages in conda-forge/obspy-feedstock#6 ..?

@megies megies added this to the 1.0.3 milestone Feb 27, 2017
@megies
Copy link
Member

megies commented Feb 27, 2017

Just for reference.. linking this to conda-forge/lxml-feedstock#10 and conda-forge/libxslt-feedstock#8

@QuLogic
Copy link
Member

QuLogic commented Mar 2, 2017

This pinning was (temporarily) added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external It's not our fault! installation issues with installing obspy packaging issue related to our packaging efforts (e.g. conda, Debian, ...) question Questions asked by users. Please use https://discourse.obspy.org for asking new questions
Projects
None yet
Development

No branches or pull requests

4 participants