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

Issue with importing obspy #2948

Closed
tianzeliu opened this issue Jan 14, 2022 · 1 comment
Closed

Issue with importing obspy #2948

tianzeliu opened this issue Jan 14, 2022 · 1 comment
Labels
duplicate Duplicate of another issue

Comments

@tianzeliu
Copy link

Hi There,
I just reinstalled obspy on my machine running OSX 11.6.1 but found that I was no longer able to import it in python. Here are the error messages:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/__init__.py", line 39, in <module>
    from obspy.core.utcdatetime import UTCDateTime  # NOQA
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/core/__init__.py", line 124, in <module>
    from obspy.core.utcdatetime import UTCDateTime  # NOQA
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/core/utcdatetime.py", line 27, in <module>
    from obspy.core.util.deprecation_helpers import ObsPyDeprecationWarning
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/core/util/__init__.py", line 27, in <module>
    from obspy.core.util.base import (ALL_MODULES, DEFAULT_MODULES,
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/core/util/base.py", line 36, in <module>
    from obspy.core.util.misc import to_int_or_zero, buffered_load_entry_point
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/obspy/core/util/misc.py", line 214, in <module>
    loadtxt(np.array([0]), ndmin=1)
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/numpy/lib/npyio.py", line 1086, in loadtxt
    ncols = len(usecols or split_line(first_line))
  File "/opt/homebrew/Caskroom/miniforge/base/envs/obspy/lib/python3.8/site-packages/numpy/lib/npyio.py", line 977, in split_line
    line = line.split(comment, 1)[0]
AttributeError: 'numpy.int64' object has no attribute 'split'

I have tried it on both python 3.8.12 and 3.10.2, and the problem is the same. My obspy was installed via Anaconda and is Version 1.2.2.

  • Please check whether the bug was already reported or fixed.
  • Please provide the following information:
    • ObsPy version, Python version and Platform (Windows, OSX, Linux ...)
    • How did you install ObsPy and Python (pip, anaconda, from source ...)
    • If possible please supply a short, self contained, correct example that
      demonstrates the issue.
    • If this is a regression (used to work in an earlier version of ObsPy),
      please note when it used to work.
  • Please take the time to format your ticket appropriately
    (e.g. put error tracebacks into code blocks)
@d-chambers
Copy link
Member

See this issue: #2912 - a new obspy release is coming to fix this. In the meantime you can downgrade to numpy 1.21.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate Duplicate of another issue
Projects
None yet
Development

No branches or pull requests

3 participants